home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Environments / Perl404 / Perl 4.04 / PerlHelp < prev    next >
MacBinary  |  1992-09-27  |  223.5 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sun Sep 27 21:35:05 1992, modified Sun Sep 27 21:35:05 1992, creator 'MPS ', type ASCII, 228063 bytes "PerlHelp" , at 0x37b5f 549 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 50 65 72 6c 48 65 | 6c 70 00 00 00 00 00 00 |..PerlHe|lp......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 03 7a df 00 | 00 02 25 a6 ec 11 c9 a6 |.....z..|..%.....|
|00000060| ec 11 c9 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 42 4b 00 00 |........|....BK..|
|00000080| be 4b 59 20 43 6f 70 79 | 72 69 67 68 74 4e 6f 74 |.KY Copy|rightNot|
|00000090| 69 63 65 0d be 43 20 20 | 4c 61 72 72 79 20 57 61 |ice..C |Larry Wa|
|000000a0| 6c 6c 20 3c 6c 77 61 6c | 6c 40 6e 65 74 6c 61 62 |ll <lwal|l@netlab|
|000000b0| 73 2e 63 6f 6d 3e 0d 4d | 61 63 69 6e 74 6f 73 68 |s.com>.M|acintosh|
|000000c0| 20 70 6f 72 74 20 62 79 | 20 0d 0d 20 20 20 4d 61 | port by| .. Ma|
|000000d0| 74 74 68 69 61 73 20 4e | 65 65 72 61 63 68 65 72 |tthias N|eeracher|
|000000e0| 20 3c 6e 65 65 72 69 40 | 69 69 73 2e 65 74 68 7a | <neeri@|iis.ethz|
|000000f0| 2e 63 68 3e 0d 20 20 20 | 54 69 6d 20 45 6e 64 72 |.ch>. |Tim Endr|
|00000100| 65 73 20 20 20 20 20 20 | 20 20 20 3c 74 69 6d 65 |es | <time|
|00000110| 40 69 63 65 2e 63 6f 6d | 3e 0d 0d be 4b 59 20 48 |@ice.com|>...KY H|
|00000120| 65 6c 70 0d 50 65 72 6c | 48 65 6c 70 0d be 4b 4c |elp.Perl|Help..KL|
|00000130| 20 41 62 6f 75 74 c9 50 | 65 72 6c 0d 50 65 72 6c | About.P|erl.Perl|
|00000140| c9 4f 70 74 69 6f 6e 73 | 0d 50 65 72 6c c9 54 79 |.Options|.Perl.Ty|
|00000150| 70 65 73 0d 50 65 72 6c | c9 53 79 6e 74 61 78 0d |pes.Perl|.Syntax.|
|00000160| 50 65 72 6c c9 43 6f 6d | 70 6f 75 6e 64 c9 53 74 |Perl.Com|pound.St|
|00000170| 61 74 65 6d 65 6e 74 73 | 0d 50 65 72 6c c9 53 69 |atements|.Perl.Si|
|00000180| 6d 70 6c 65 c9 53 74 61 | 74 65 6d 65 6e 74 73 0d |mple.Sta|tements.|
|00000190| 50 65 72 6c c9 45 78 70 | 72 65 73 73 69 6f 6e 73 |Perl.Exp|ressions|
|000001a0| 0d 50 65 72 6c c9 4f 70 | 65 72 61 74 6f 72 73 0d |.Perl.Op|erators.|
|000001b0| 50 65 72 6c c9 50 72 65 | 63 65 64 65 6e 63 65 0d |Perl.Pre|cedence.|
|000001c0| 50 65 72 6c c9 53 75 62 | 72 6f 75 74 69 6e 65 73 |Perl.Sub|routines|
|000001d0| 0d 50 65 72 6c c9 52 65 | 67 65 78 70 0d 50 65 72 |.Perl.Re|gexp.Per|
|000001e0| 6c c9 46 6f 72 6d 61 74 | 73 0d 50 65 72 6c c9 49 |l.Format|s.Perl.I|
|000001f0| 50 43 0d 50 65 72 6c c9 | 56 61 72 69 61 62 6c 65 |PC.Perl.|Variable|
|00000200| 73 0d 50 65 72 6c c9 50 | 61 63 6b 61 67 65 73 0d |s.Perl.P|ackages.|
|00000210| 50 65 72 6c c9 53 74 79 | 6c 65 0d 50 65 72 6c c9 |Perl.Sty|le.Perl.|
|00000220| 44 65 62 75 67 67 69 6e | 67 0d 50 65 72 6c c9 45 |Debuggin|g.Perl.E|
|00000230| 6e 76 69 72 6f 6e 6d 65 | 6e 74 0d 50 65 72 6c c9 |nvironme|nt.Perl.|
|00000240| 44 69 61 67 6e 6f 73 74 | 69 63 73 0d 50 65 72 6c |Diagnost|ics.Perl|
|00000250| c9 54 72 61 70 73 0d 50 | 65 72 6c c9 45 72 72 61 |.Traps.P|erl.Erra|
|00000260| 74 61 0d 50 65 72 6c c9 | 42 75 67 73 0d 50 65 72 |ta.Perl.|Bugs.Per|
|00000270| 6c c9 4d 61 63 69 6e 74 | 6f 73 68 c9 45 78 74 65 |l.Macint|osh.Exte|
|00000280| 6e 73 69 6f 6e 73 0d 0d | 61 63 63 65 70 74 0d 61 |nsions..|accept.a|
|00000290| 6c 61 72 6d 0d 61 74 61 | 6e 32 0d 62 69 6e 64 0d |larm.ata|n2.bind.|
|000002a0| 62 69 6e 6d 6f 64 65 0d | 63 61 6c 6c 65 72 0d 63 |binmode.|caller.c|
|000002b0| 68 64 69 72 0d 63 68 6d | 6f 64 0d 63 68 6f 70 0d |hdir.chm|od.chop.|
|000002c0| 63 68 6f 77 6e 0d 63 68 | 72 6f 6f 74 0d 63 6c 6f |chown.ch|root.clo|
|000002d0| 73 65 0d 63 6c 6f 73 65 | 64 69 72 0d 63 6f 6e 6e |se.close|dir.conn|
|000002e0| 65 63 74 0d 63 6f 73 0d | 63 72 79 70 74 0d 64 62 |ect.cos.|crypt.db|
|000002f0| 6d 63 6c 6f 73 65 0d 64 | 62 6d 6f 70 65 6e 0d 64 |mclose.d|bmopen.d|
|00000300| 65 66 69 6e 65 64 0d 64 | 65 6c 65 74 65 0d 64 69 |efined.d|elete.di|
|00000310| 65 0d 64 6f 0d 64 75 6d | 70 0d 65 61 63 68 0d 65 |e.do.dum|p.each.e|
|00000320| 6f 66 0d 65 76 61 6c 0d | 65 78 65 63 0d 65 78 69 |of.eval.|exec.exi|
|00000330| 74 0d 65 78 70 0d 66 63 | 6e 74 6c 0d 66 69 6c 65 |t.exp.fc|ntl.file|
|00000340| 6e 6f 0d 66 6c 6f 63 6b | 0d 66 6f 72 6b 0d 67 65 |no.flock|.fork.ge|
|00000350| 74 63 0d 67 65 74 6c 6f | 67 69 6e 0d 67 65 74 70 |tc.getlo|gin.getp|
|00000360| 65 65 72 6e 61 6d 65 0d | 67 65 74 70 67 72 70 0d |eername.|getpgrp.|
|00000370| 67 65 74 70 70 69 64 0d | 67 65 74 70 72 69 6f 72 |getppid.|getprior|
|00000380| 69 74 79 0d 67 65 74 70 | 77 6e 61 6d 0d 67 65 74 |ity.getp|wnam.get|
|00000390| 73 6f 63 6b 6e 61 6d 65 | 0d 67 65 74 73 6f 63 6b |sockname|.getsock|
|000003a0| 6f 70 74 0d 67 6d 74 69 | 6d 65 0d 67 6f 74 6f 0d |opt.gmti|me.goto.|
|000003b0| 67 72 65 70 0d 68 65 78 | 0d 69 6e 64 65 78 0d 69 |grep.hex|.index.i|
|000003c0| 6e 74 0d 69 6f 63 74 6c | 0d 6a 6f 69 6e 0d 6b 65 |nt.ioctl|.join.ke|
|000003d0| 79 73 0d 6b 69 6c 6c 0d | 6c 61 73 74 0d 6c 65 6e |ys.kill.|last.len|
|000003e0| 67 74 68 0d 6c 69 6e 6b | 0d 6c 69 73 74 65 6e 0d |gth.link|.listen.|
|000003f0| 6c 6f 63 61 6c 0d 6c 6f | 63 61 6c 74 69 6d 65 0d |local.lo|caltime.|
|00000400| 6c 6f 67 0d 6c 73 74 61 | 74 0d 6d 0d 6d 6b 64 69 |log.lsta|t.m.mkdi|
|00000410| 72 0d 6d 73 67 63 74 6c | 0d 6d 73 67 67 65 74 0d |r.msgctl|.msgget.|
|00000420| 6d 73 67 73 6e 64 0d 6d | 73 67 72 63 76 0d 6e 65 |msgsnd.m|sgrcv.ne|
|00000430| 78 74 0d 6f 63 74 0d 6f | 70 65 6e 0d 6f 70 65 6e |xt.oct.o|pen.open|
|00000440| 64 69 72 0d 6f 72 64 0d | 70 61 63 6b 0d 70 69 70 |dir.ord.|pack.pip|
|00000450| 65 0d 70 6f 70 0d 70 72 | 69 6e 74 0d 70 72 69 6e |e.pop.pr|int.prin|
|00000460| 74 66 0d 70 75 73 68 0d | 71 0d 72 61 6e 64 0d 72 |tf.push.|q.rand.r|
|00000470| 65 61 64 0d 72 65 61 64 | 64 69 72 0d 72 65 61 64 |ead.read|dir.read|
|00000480| 6c 69 6e 6b 0d 72 65 63 | 76 0d 72 65 64 6f 0d 72 |link.rec|v.redo.r|
|00000490| 65 6e 61 6d 65 0d 72 65 | 71 75 69 72 65 0d 72 65 |ename.re|quire.re|
|000004a0| 73 65 74 0d 72 65 74 75 | 72 6e 0d 72 65 76 65 72 |set.retu|rn.rever|
|000004b0| 73 65 0d 72 65 77 69 6e | 64 64 69 72 0d 72 69 6e |se.rewin|ddir.rin|
|000004c0| 64 65 78 0d 72 6d 64 69 | 72 0d 73 0d 73 63 61 6c |dex.rmdi|r.s.scal|
|000004d0| 61 72 0d 73 65 65 6b 0d | 73 65 65 6b 64 69 72 0d |ar.seek.|seekdir.|
|000004e0| 73 65 6c 65 63 74 0d 73 | 65 6d 63 74 6c 0d 73 65 |select.s|emctl.se|
|000004f0| 6d 67 65 74 0d 73 65 6d | 6f 70 0d 73 65 6e 64 0d |mget.sem|op.send.|
|00000500| 73 65 74 70 67 72 70 0d | 73 65 74 70 72 69 6f 72 |setpgrp.|setprior|
|00000510| 69 74 79 0d 73 65 74 73 | 6f 63 6b 6f 70 74 0d 73 |ity.sets|ockopt.s|
|00000520| 68 69 66 74 0d 73 68 6d | 63 74 6c 0d 73 68 6d 67 |hift.shm|ctl.shmg|
|00000530| 65 74 0d 73 68 6d 72 65 | 61 64 0d 73 68 75 74 64 |et.shmre|ad.shutd|
|00000540| 6f 77 6e 0d 73 69 6e 0d | 73 6c 65 65 70 0d 73 6f |own.sin.|sleep.so|
|00000550| 63 6b 65 74 0d 73 6f 63 | 6b 65 74 70 61 69 72 0d |cket.soc|ketpair.|
|00000560| 73 6f 72 74 0d 73 70 6c | 69 63 65 0d 73 70 6c 69 |sort.spl|ice.spli|
|00000570| 74 0d 73 70 72 69 6e 74 | 66 0d 73 71 72 74 0d 73 |t.sprint|f.sqrt.s|
|00000580| 72 61 6e 64 0d 73 74 61 | 74 0d 73 74 75 64 79 0d |rand.sta|t.study.|
|00000590| 73 75 62 73 74 72 0d 73 | 79 6d 6c 69 6e 6b 0d 73 |substr.s|ymlink.s|
|000005a0| 79 73 63 61 6c 6c 0d 73 | 79 73 72 65 61 64 0d 73 |yscall.s|ysread.s|
|000005b0| 79 73 74 65 6d 0d 73 79 | 73 77 72 69 74 65 0d 74 |ystem.sy|swrite.t|
|000005c0| 65 6c 6c 0d 74 65 6c 6c | 64 69 72 0d 74 69 6d 65 |ell.tell|dir.time|
|000005d0| 0d 74 69 6d 65 73 0d 74 | 72 0d 74 72 75 6e 63 61 |.times.t|r.trunca|
|000005e0| 74 65 0d 75 6d 61 73 6b | 0d 75 6e 64 65 66 0d 75 |te.umask|.undef.u|
|000005f0| 6e 6c 69 6e 6b 0d 75 6e | 70 61 63 6b 0d 75 6e 73 |nlink.un|pack.uns|
|00000600| 68 69 66 74 0d 75 74 69 | 6d 65 0d 76 61 6c 75 65 |hift.uti|me.value|
|00000610| 73 0d 76 65 63 0d 77 61 | 69 74 0d 77 61 69 74 70 |s.vec.wa|it.waitp|
|00000620| 69 64 0d 77 61 6e 74 61 | 72 72 61 79 0d 77 61 72 |id.wanta|rray.war|
|00000630| 6e 0d 77 72 69 74 65 0d | be 4b 59 20 50 65 72 6c |n.write.|.KY Perl|
|00000640| 0d 41 62 6f 75 74 c9 50 | 65 72 6c 0d be 43 0d 50 |.About.P|erl..C.P|
|00000650| 65 72 6c 20 2d 2d 20 50 | 72 61 63 74 69 63 61 6c |erl -- P|ractical|
|00000660| 20 45 78 74 72 61 63 74 | 69 6f 6e 20 61 6e 64 20 | Extract|ion and |
|00000670| 52 65 70 6f 72 74 20 4c | 61 6e 67 75 61 67 65 0d |Report L|anguage.|
|00000680| 0d 50 65 72 6c 20 69 73 | 20 61 6e 20 69 6e 74 65 |.Perl is| an inte|
|00000690| 72 70 72 65 74 65 64 20 | 6c 61 6e 67 75 61 67 65 |rpreted |language|
|000006a0| 20 6f 70 74 69 6d 69 7a | 65 64 20 66 6f 72 20 73 | optimiz|ed for s|
|000006b0| 63 61 6e 6e 69 6e 67 20 | 61 72 62 69 74 72 61 72 |canning |arbitrar|
|000006c0| 79 0d 74 65 78 74 20 66 | 69 6c 65 73 2c 20 65 78 |y.text f|iles, ex|
|000006d0| 74 72 61 63 74 69 6e 67 | 20 69 6e 66 6f 72 6d 61 |tracting| informa|
|000006e0| 74 69 6f 6e 20 66 72 6f | 6d 20 74 68 6f 73 65 20 |tion fro|m those |
|000006f0| 74 65 78 74 20 66 69 6c | 65 73 2c 20 61 6e 64 0d |text fil|es, and.|
|00000700| 70 72 69 6e 74 69 6e 67 | 20 72 65 70 6f 72 74 73 |printing| reports|
|00000710| 20 62 61 73 65 64 20 6f | 6e 20 74 68 61 74 20 69 | based o|n that i|
|00000720| 6e 66 6f 72 6d 61 74 69 | 6f 6e 2e 20 49 74 27 73 |nformati|on. It's|
|00000730| 20 61 6c 73 6f 20 61 20 | 67 6f 6f 64 0d 6c 61 6e | also a |good.lan|
|00000740| 67 75 61 67 65 20 66 6f | 72 20 6d 61 6e 79 20 73 |guage fo|r many s|
|00000750| 79 73 74 65 6d 20 6d 61 | 6e 61 67 65 6d 65 6e 74 |ystem ma|nagement|
|00000760| 20 74 61 73 6b 73 2e 20 | 54 68 65 20 6c 61 6e 67 | tasks. |The lang|
|00000770| 75 61 67 65 20 69 73 20 | 69 6e 74 65 6e 64 65 64 |uage is |intended|
|00000780| 0d 74 6f 20 62 65 20 70 | 72 61 63 74 69 63 61 6c |.to be p|ractical|
|00000790| 20 28 65 61 73 79 20 74 | 6f 20 75 73 65 2c 20 65 | (easy t|o use, e|
|000007a0| 66 66 69 63 69 65 6e 74 | 2c 20 63 6f 6d 70 6c 65 |fficient|, comple|
|000007b0| 74 65 29 20 72 61 74 68 | 65 72 20 74 68 61 6e 0d |te) rath|er than.|
|000007c0| 62 65 61 75 74 69 66 75 | 6c 20 28 74 69 6e 79 2c |beautifu|l (tiny,|
|000007d0| 20 65 6c 65 67 61 6e 74 | 2c 20 6d 69 6e 69 6d 61 | elegant|, minima|
|000007e0| 6c 29 2e 20 20 49 74 20 | 63 6f 6d 62 69 6e 65 73 |l). It |combines|
|000007f0| 20 28 69 6e 20 74 68 65 | 20 61 75 74 68 6f 72 27 | (in the| author'|
|00000800| 73 0d 6f 70 69 6e 69 6f | 6e 2c 20 61 6e 79 77 61 |s.opinio|n, anywa|
|00000810| 79 29 20 73 6f 6d 65 20 | 6f 66 20 74 68 65 20 62 |y) some |of the b|
|00000820| 65 73 74 20 66 65 61 74 | 75 72 65 73 20 6f 66 20 |est feat|ures of |
|00000830| 43 2c 20 73 65 64 2c 20 | 61 77 6b 2c 20 61 6e 64 |C, sed, |awk, and|
|00000840| 20 73 68 2c 0d 73 6f 20 | 70 65 6f 70 6c 65 20 66 | sh,.so |people f|
|00000850| 61 6d 69 6c 69 61 72 20 | 77 69 74 68 20 74 68 6f |amiliar |with tho|
|00000860| 73 65 20 6c 61 6e 67 75 | 61 67 65 73 20 73 68 6f |se langu|ages sho|
|00000870| 75 6c 64 20 68 61 76 65 | 20 6c 69 74 74 6c 65 0d |uld have| little.|
|00000880| 64 69 66 66 69 63 75 6c | 74 79 20 77 69 74 68 20 |difficul|ty with |
|00000890| 69 74 2e 20 20 28 4c 61 | 6e 67 75 61 67 65 20 68 |it. (La|nguage h|
|000008a0| 69 73 74 6f 72 69 61 6e | 73 20 77 69 6c 6c 20 61 |istorian|s will a|
|000008b0| 6c 73 6f 20 6e 6f 74 65 | 20 73 6f 6d 65 0d 76 65 |lso note| some.ve|
|000008c0| 73 74 69 67 65 73 20 6f | 66 20 63 73 68 2c 20 50 |stiges o|f csh, P|
|000008d0| 61 73 63 61 6c 2c 20 61 | 6e 64 20 65 76 65 6e 20 |ascal, a|nd even |
|000008e0| 42 41 53 49 43 2d 50 4c | 55 53 2e 29 20 45 78 70 |BASIC-PL|US.) Exp|
|000008f0| 72 65 73 73 69 6f 6e 20 | 73 79 6e 74 61 78 0d 63 |ression |syntax.c|
|00000900| 6f 72 72 65 73 70 6f 6e | 64 73 20 71 75 69 74 65 |orrespon|ds quite|
|00000910| 20 63 6c 6f 73 65 6c 79 | 20 74 6f 20 43 20 65 78 | closely| to C ex|
|00000920| 70 72 65 73 73 69 6f 6e | 20 73 79 6e 74 61 78 2e |pression| syntax.|
|00000930| 20 55 6e 6c 69 6b 65 20 | 6d 6f 73 74 20 55 6e 69 | Unlike |most Uni|
|00000940| 78 0d 75 74 69 6c 69 74 | 69 65 73 2c 20 70 65 72 |x.utilit|ies, per|
|00000950| 6c 20 64 6f 65 73 20 6e | 6f 74 20 61 72 62 69 74 |l does n|ot arbit|
|00000960| 72 61 72 69 6c 79 20 6c | 69 6d 69 74 20 74 68 65 |rarily l|imit the|
|00000970| 20 73 69 7a 65 20 6f 66 | 20 79 6f 75 72 20 64 61 | size of| your da|
|00000980| 74 61 2d 2d 69 66 0d 79 | 6f 75 27 76 65 20 67 6f |ta--if.y|ou've go|
|00000990| 74 20 74 68 65 20 6d 65 | 6d 6f 72 79 2c 20 70 65 |t the me|mory, pe|
|000009a0| 72 6c 20 63 61 6e 20 73 | 6c 75 72 70 20 69 6e 20 |rl can s|lurp in |
|000009b0| 79 6f 75 72 20 77 68 6f | 6c 65 20 66 69 6c 65 20 |your who|le file |
|000009c0| 61 73 20 61 20 73 69 6e | 67 6c 65 0d 73 74 72 69 |as a sin|gle.stri|
|000009d0| 6e 67 2e 20 52 65 63 75 | 72 73 69 6f 6e 20 69 73 |ng. Recu|rsion is|
|000009e0| 20 6f 66 20 75 6e 6c 69 | 6d 69 74 65 64 20 64 65 | of unli|mited de|
|000009f0| 70 74 68 2e 20 20 41 6e | 64 20 74 68 65 20 68 61 |pth. An|d the ha|
|00000a00| 73 68 20 74 61 62 6c 65 | 73 20 75 73 65 64 20 62 |sh table|s used b|
|00000a10| 79 0d 61 73 73 6f 63 69 | 61 74 69 76 65 20 61 72 |y.associ|ative ar|
|00000a20| 72 61 79 73 20 67 72 6f | 77 20 61 73 20 6e 65 63 |rays gro|w as nec|
|00000a30| 65 73 73 61 72 79 20 74 | 6f 20 70 72 65 76 65 6e |essary t|o preven|
|00000a40| 74 20 64 65 67 72 61 64 | 65 64 20 70 65 72 66 6f |t degrad|ed perfo|
|00000a50| 72 6d 61 6e 63 65 2e 0d | 50 65 72 6c 20 75 73 65 |rmance..|Perl use|
|00000a60| 73 20 73 6f 70 68 69 73 | 74 69 2d 20 63 61 74 65 |s sophis|ti- cate|
|00000a70| 64 20 70 61 74 74 65 72 | 6e 20 6d 61 74 63 68 69 |d patter|n matchi|
|00000a80| 6e 67 20 74 65 63 68 6e | 69 71 75 65 73 20 74 6f |ng techn|iques to|
|00000a90| 20 73 63 61 6e 20 6c 61 | 72 67 65 0d 61 6d 6f 75 | scan la|rge.amou|
|00000aa0| 6e 74 73 20 6f 66 20 64 | 61 74 61 20 76 65 72 79 |nts of d|ata very|
|00000ab0| 20 71 75 69 63 6b 6c 79 | 2e 20 41 6c 74 68 6f 75 | quickly|. Althou|
|00000ac0| 67 68 20 6f 70 74 69 6d | 69 7a 65 64 20 66 6f 72 |gh optim|ized for|
|00000ad0| 20 73 63 61 6e 6e 69 6e | 67 20 74 65 78 74 2c 0d | scannin|g text,.|
|00000ae0| 70 65 72 6c 20 63 61 6e | 20 61 6c 73 6f 20 64 65 |perl can| also de|
|00000af0| 61 6c 20 77 69 74 68 20 | 62 69 6e 61 72 79 20 64 |al with |binary d|
|00000b00| 61 74 61 2c 20 61 6e 64 | 20 63 61 6e 20 6d 61 6b |ata, and| can mak|
|00000b10| 65 20 64 62 6d 20 66 69 | 6c 65 73 20 6c 6f 6f 6b |e dbm fi|les look|
|00000b20| 20 6c 69 6b 65 0d 61 73 | 73 6f 63 69 61 74 69 76 | like.as|sociativ|
|00000b30| 65 20 61 72 72 61 79 73 | 20 28 77 68 65 72 65 20 |e arrays| (where |
|00000b40| 64 62 6d 20 69 73 20 61 | 76 61 69 6c 61 62 6c 65 |dbm is a|vailable|
|00000b50| 29 2e 20 53 65 74 75 69 | 64 20 70 65 72 6c 20 73 |). Setui|d perl s|
|00000b60| 63 72 69 70 74 73 20 61 | 72 65 0d 73 61 66 65 72 |cripts a|re.safer|
|00000b70| 20 74 68 61 6e 20 43 20 | 70 72 6f 67 72 61 6d 73 | than C |programs|
|00000b80| 20 74 68 72 6f 75 67 68 | 20 61 20 64 61 74 61 66 | through| a dataf|
|00000b90| 6c 6f 77 20 74 72 61 63 | 69 6e 67 20 6d 65 63 68 |low trac|ing mech|
|00000ba0| 61 6e 69 73 6d 20 77 68 | 69 63 68 0d 70 72 65 76 |anism wh|ich.prev|
|00000bb0| 65 6e 74 73 20 6d 61 6e | 79 20 73 74 75 70 69 64 |ents man|y stupid|
|00000bc0| 20 73 65 63 75 72 69 74 | 79 20 68 6f 6c 65 73 2e | securit|y holes.|
|00000bd0| 20 20 49 66 20 79 6f 75 | 20 68 61 76 65 20 61 20 | If you| have a |
|00000be0| 70 72 6f 62 6c 65 6d 20 | 74 68 61 74 0d 77 6f 75 |problem |that.wou|
|00000bf0| 6c 64 20 6f 72 64 69 6e | 61 72 69 6c 79 20 75 73 |ld ordin|arily us|
|00000c00| 65 20 73 65 64 20 6f 72 | 20 61 77 6b 20 6f 72 20 |e sed or| awk or |
|00000c10| 73 68 2c 20 62 75 74 20 | 69 74 20 65 78 63 65 65 |sh, but |it excee|
|00000c20| 64 73 20 74 68 65 69 72 | 0d 63 61 70 61 62 69 6c |ds their|.capabil|
|00000c30| 69 74 69 65 73 20 6f 72 | 20 6d 75 73 74 20 72 75 |ities or| must ru|
|00000c40| 6e 20 61 20 6c 69 74 74 | 6c 65 20 66 61 73 74 65 |n a litt|le faste|
|00000c50| 72 2c 20 61 6e 64 20 79 | 6f 75 20 64 6f 6e 27 74 |r, and y|ou don't|
|00000c60| 20 77 61 6e 74 20 74 6f | 20 77 72 69 74 65 0d 74 | want to| write.t|
|00000c70| 68 65 20 73 69 6c 6c 79 | 20 74 68 69 6e 67 20 69 |he silly| thing i|
|00000c80| 6e 20 43 2c 20 74 68 65 | 6e 20 70 65 72 6c 20 6d |n C, the|n perl m|
|00000c90| 61 79 20 62 65 20 66 6f | 72 20 79 6f 75 2e 20 20 |ay be fo|r you. |
|00000ca0| 54 68 65 72 65 20 61 72 | 65 20 61 6c 73 6f 0d 74 |There ar|e also.t|
|00000cb0| 72 61 6e 73 6c 61 74 6f | 72 73 20 74 6f 20 74 75 |ranslato|rs to tu|
|00000cc0| 72 6e 20 79 6f 75 72 20 | 73 65 64 20 61 6e 64 20 |rn your |sed and |
|00000cd0| 61 77 6b 20 73 63 72 69 | 70 74 73 20 69 6e 74 6f |awk scri|pts into|
|00000ce0| 20 70 65 72 6c 20 73 63 | 72 69 70 74 73 2e 0d 4f | perl sc|ripts..O|
|00000cf0| 4b 2c 20 65 6e 6f 75 67 | 68 20 68 79 70 65 2e 0d |K, enoug|h hype..|
|00000d00| 0d 55 70 6f 6e 20 73 74 | 61 72 74 75 70 2c 20 70 |.Upon st|artup, p|
|00000d10| 65 72 6c 20 6c 6f 6f 6b | 73 20 66 6f 72 20 79 6f |erl look|s for yo|
|00000d20| 75 72 20 73 63 72 69 70 | 74 20 69 6e 20 6f 6e 65 |ur scrip|t in one|
|00000d30| 20 6f 66 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e | of the |followin|
|00000d40| 67 0d 70 6c 61 63 65 73 | 3a 0d 0d 31 2e 20 20 53 |g.places|:..1. S|
|00000d50| 70 65 63 69 66 69 65 64 | 20 6c 69 6e 65 20 62 79 |pecified| line by|
|00000d60| 20 6c 69 6e 65 20 76 69 | 61 20 2d 65 20 73 77 69 | line vi|a -e swi|
|00000d70| 74 63 68 65 73 20 6f 6e | 20 74 68 65 20 63 6f 6d |tches on| the com|
|00000d80| 6d 61 6e 64 20 6c 69 6e | 65 2e 0d 0d 32 2e 20 20 |mand lin|e...2. |
|00000d90| 43 6f 6e 74 61 69 6e 65 | 64 20 69 6e 20 74 68 65 |Containe|d in the|
|00000da0| 20 66 69 6c 65 20 73 70 | 65 63 69 66 69 65 64 20 | file sp|ecified |
|00000db0| 62 79 20 74 68 65 20 66 | 69 72 73 74 20 66 69 6c |by the f|irst fil|
|00000dc0| 65 6e 61 6d 65 20 6f 6e | 20 74 68 65 0d 20 20 20 |ename on| the. |
|00000dd0| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 2e 20 20 | command| line. |
|00000de0| 28 4e 6f 74 65 20 74 68 | 61 74 20 73 79 73 74 65 |(Note th|at syste|
|00000df0| 6d 73 20 73 75 70 70 6f | 72 74 69 6e 67 20 74 68 |ms suppo|rting th|
|00000e00| 65 20 23 21 20 6e 6f 74 | 61 74 69 6f 6e 0d 20 20 |e #! not|ation. |
|00000e10| 20 20 69 6e 76 6f 6b 65 | 20 69 6e 74 65 72 70 72 | invoke| interpr|
|00000e20| 65 74 65 72 73 20 74 68 | 69 73 20 77 61 79 2e 29 |eters th|is way.)|
|00000e30| 0d 0d 33 2e 20 20 50 61 | 73 73 65 64 20 69 6e 20 |..3. Pa|ssed in |
|00000e40| 69 6d 70 6c 69 63 69 74 | 6c 79 20 76 69 61 20 73 |implicit|ly via s|
|00000e50| 74 61 6e 64 61 72 64 20 | 69 6e 70 75 74 2e 20 20 |tandard |input. |
|00000e60| 54 68 69 73 20 6f 6e 6c | 79 20 77 6f 72 6b 73 20 |This onl|y works |
|00000e70| 69 66 0d 20 20 20 20 74 | 68 65 72 65 20 61 72 65 |if. t|here are|
|00000e80| 20 6e 6f 20 66 69 6c 65 | 6e 61 6d 65 20 61 72 67 | no file|name arg|
|00000e90| 75 6d 65 6e 74 73 2d 2d | 74 6f 20 70 61 73 73 20 |uments--|to pass |
|00000ea0| 61 72 67 75 6d 65 6e 74 | 73 20 74 6f 20 61 20 73 |argument|s to a s|
|00000eb0| 74 64 69 6e 0d 20 20 20 | 20 73 63 72 69 70 74 20 |tdin. | script |
|00000ec0| 79 6f 75 20 6d 75 73 74 | 20 65 78 70 6c 69 63 69 |you must| explici|
|00000ed0| 74 6c 79 20 73 70 65 63 | 69 66 79 20 61 20 2d 20 |tly spec|ify a - |
|00000ee0| 66 6f 72 20 74 68 65 20 | 73 63 72 69 70 74 20 6e |for the |script n|
|00000ef0| 61 6d 65 2e 0d 0d 41 66 | 74 65 72 20 6c 6f 63 61 |ame...Af|ter loca|
|00000f00| 74 69 6e 67 20 79 6f 75 | 72 20 73 63 72 69 70 74 |ting you|r script|
|00000f10| 2c 20 70 65 72 6c 20 63 | 6f 6d 70 69 6c 65 73 20 |, perl c|ompiles |
|00000f20| 69 74 20 74 6f 20 61 6e | 20 69 6e 74 65 72 6e 61 |it to an| interna|
|00000f30| 6c 20 66 6f 72 6d 2e 0d | 49 66 20 74 68 65 20 73 |l form..|If the s|
|00000f40| 63 72 69 70 74 20 69 73 | 20 73 79 6e 74 61 63 74 |cript is| syntact|
|00000f50| 69 63 61 6c 6c 79 20 63 | 6f 72 72 65 63 74 2c 20 |ically c|orrect, |
|00000f60| 69 74 20 69 73 20 65 78 | 65 63 75 74 65 64 2e 0d |it is ex|ecuted..|
|00000f70| 0d be 4b 59 20 50 65 72 | 6c c9 4f 70 74 69 6f 6e |..KY Per|l.Option|
|00000f80| 73 0d be 43 20 41 20 73 | 69 6e 67 6c 65 2d 63 68 |s..C A s|ingle-ch|
|00000f90| 61 72 61 63 74 65 72 20 | 6f 70 74 69 6f 6e 20 6d |aracter |option m|
|00000fa0| 61 79 20 62 65 20 63 6f | 6d 62 69 6e 65 64 20 77 |ay be co|mbined w|
|00000fb0| 69 74 68 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |ith the |followin|
|00000fc0| 67 0d 6f 70 74 69 6f 6e | 2c 20 69 66 20 61 6e 79 |g.option|, if any|
|00000fd0| 2e 20 20 54 68 69 73 20 | 69 73 20 70 61 72 74 69 |. This |is parti|
|00000fe0| 63 75 6c 61 72 6c 79 20 | 75 73 65 66 75 6c 20 77 |cularly |useful w|
|00000ff0| 68 65 6e 20 69 6e 76 6f | 6b 69 6e 67 20 61 0d 73 |hen invo|king a.s|
|00001000| 63 72 69 70 74 20 75 73 | 69 6e 67 20 74 68 65 20 |cript us|ing the |
|00001010| 23 21 20 63 6f 6e 73 74 | 72 75 63 74 20 77 68 69 |#! const|ruct whi|
|00001020| 63 68 20 6f 6e 6c 79 20 | 61 6c 6c 6f 77 73 20 6f |ch only |allows o|
|00001030| 6e 65 20 61 72 67 75 6d | 65 6e 74 2e 0d 45 78 61 |ne argum|ent..Exa|
|00001040| 6d 70 6c 65 3a 0d 0d 20 | 20 20 20 20 23 21 2f 75 |mple:.. | #!/u|
|00001050| 73 72 2f 62 69 6e 2f 70 | 65 72 6c 20 2d 73 70 69 |sr/bin/p|erl -spi|
|00001060| 2e 62 61 6b 20 23 20 73 | 61 6d 65 20 61 73 20 2d |.bak # s|ame as -|
|00001070| 73 20 2d 70 20 2d 69 2e | 62 61 6b 0d 20 20 20 20 |s -p -i.|bak. |
|00001080| 20 2e 2e 2e 0d 0d 4f 70 | 74 69 6f 6e 73 20 69 6e | .....Op|tions in|
|00001090| 63 6c 75 64 65 3a 0d 0d | 2d 30 64 69 67 69 74 73 |clude:..|-0digits|
|000010a0| 0d 20 20 20 20 20 73 70 | 65 63 69 66 69 65 73 20 |. sp|ecifies |
|000010b0| 74 68 65 20 72 65 63 6f | 72 64 20 73 65 70 61 72 |the reco|rd separ|
|000010c0| 61 74 6f 72 20 28 24 2f | 29 20 61 73 20 61 6e 20 |ator ($/|) as an |
|000010d0| 6f 63 74 61 6c 20 6e 75 | 6d 62 65 72 2e 20 20 49 |octal nu|mber. I|
|000010e0| 66 0d 20 20 20 20 20 74 | 68 65 72 65 20 61 72 65 |f. t|here are|
|000010f0| 20 6e 6f 20 64 69 67 69 | 74 73 2c 20 74 68 65 20 | no digi|ts, the |
|00001100| 6e 75 6c 6c 20 63 68 61 | 72 61 63 74 65 72 20 69 |null cha|racter i|
|00001110| 73 20 74 68 65 20 73 65 | 70 61 72 61 74 6f 72 2e |s the se|parator.|
|00001120| 0d 20 20 20 20 20 4f 74 | 68 65 72 20 73 77 69 74 |. Ot|her swit|
|00001130| 63 68 65 73 20 6d 61 79 | 20 70 72 65 63 65 64 65 |ches may| precede|
|00001140| 20 6f 72 20 66 6f 6c 6c | 6f 77 20 74 68 65 20 64 | or foll|ow the d|
|00001150| 69 67 69 74 73 2e 20 20 | 46 6f 72 20 65 78 61 6d |igits. |For exam|
|00001160| 2d 0d 20 20 20 20 20 70 | 6c 65 2c 20 69 66 20 79 |-. p|le, if y|
|00001170| 6f 75 20 68 61 76 65 20 | 61 20 76 65 72 73 69 6f |ou have |a versio|
|00001180| 6e 20 6f 66 20 66 69 6e | 64 20 77 68 69 63 68 20 |n of fin|d which |
|00001190| 63 61 6e 20 70 72 69 6e | 74 20 66 69 6c 65 6e 61 |can prin|t filena|
|000011a0| 6d 65 73 0d 20 20 20 20 | 20 74 65 72 6d 69 6e 61 |mes. | termina|
|000011b0| 74 65 64 20 62 79 20 74 | 68 65 20 6e 75 6c 6c 20 |ted by t|he null |
|000011c0| 63 68 61 72 61 63 74 65 | 72 2c 20 79 6f 75 20 63 |characte|r, you c|
|000011d0| 61 6e 20 73 61 79 20 74 | 68 69 73 3a 0d 0d 20 20 |an say t|his:.. |
|000011e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 66 69 6e | | fin|
|000011f0| 64 20 2e 20 2d 6e 61 6d | 65 20 27 2a 2e 62 61 6b |d . -nam|e '*.bak|
|00001200| 27 20 2d 70 72 69 6e 74 | 30 20 7c 20 70 65 72 6c |' -print|0 | perl|
|00001210| 20 2d 6e 30 65 20 75 6e | 6c 69 6e 6b 0d 0d 20 20 | -n0e un|link.. |
|00001220| 20 20 20 54 68 65 20 73 | 70 65 63 69 61 6c 20 76 | The s|pecial v|
|00001230| 61 6c 75 65 20 30 30 20 | 77 69 6c 6c 20 63 61 75 |alue 00 |will cau|
|00001240| 73 65 20 50 65 72 6c 20 | 74 6f 20 73 6c 75 72 70 |se Perl |to slurp|
|00001250| 20 66 69 6c 65 73 20 69 | 6e 20 70 61 72 61 2d 0d | files i|n para-.|
|00001260| 20 20 20 20 20 67 72 61 | 70 68 20 6d 6f 64 65 2e | gra|ph mode.|
|00001270| 20 20 54 68 65 20 76 61 | 6c 75 65 20 30 37 37 37 | The va|lue 0777|
|00001280| 20 77 69 6c 6c 20 63 61 | 75 73 65 20 50 65 72 6c | will ca|use Perl|
|00001290| 20 74 6f 20 73 6c 75 72 | 70 20 66 69 6c 65 73 0d | to slur|p files.|
|000012a0| 20 20 20 20 20 77 68 6f | 6c 65 20 73 69 6e 63 65 | who|le since|
|000012b0| 20 74 68 65 72 65 20 69 | 73 20 6e 6f 20 6c 65 67 | there i|s no leg|
|000012c0| 61 6c 20 63 68 61 72 61 | 63 74 65 72 20 77 69 74 |al chara|cter wit|
|000012d0| 68 20 74 68 61 74 20 76 | 61 6c 75 65 2e 0d 0d 2d |h that v|alue...-|
|000012e0| 61 20 20 20 74 75 72 6e | 73 20 6f 6e 20 61 75 74 |a turn|s on aut|
|000012f0| 6f 73 70 6c 69 74 20 6d | 6f 64 65 20 77 68 65 6e |osplit m|ode when|
|00001300| 20 75 73 65 64 20 77 69 | 74 68 20 61 20 2d 6e 20 | used wi|th a -n |
|00001310| 6f 72 20 2d 70 2e 20 20 | 41 6e 0d 20 20 20 20 20 |or -p. |An. |
|00001320| 69 6d 70 6c 69 63 69 74 | 20 73 70 6c 69 74 20 63 |implicit| split c|
|00001330| 6f 6d 6d 61 6e 64 20 74 | 6f 20 74 68 65 20 40 46 |ommand t|o the @F|
|00001340| 20 61 72 72 61 79 20 69 | 73 20 64 6f 6e 65 20 61 | array i|s done a|
|00001350| 73 20 74 68 65 20 66 69 | 72 73 74 0d 20 20 20 20 |s the fi|rst. |
|00001360| 20 74 68 69 6e 67 20 69 | 6e 73 69 64 65 20 74 68 | thing i|nside th|
|00001370| 65 20 69 6d 70 6c 69 63 | 69 74 20 77 68 69 6c 65 |e implic|it while|
|00001380| 20 6c 6f 6f 70 20 70 72 | 6f 64 75 63 65 64 20 62 | loop pr|oduced b|
|00001390| 79 20 74 68 65 20 2d 6e | 20 6f 72 20 2d 70 2e 0d |y the -n| or -p..|
|000013a0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000013b0| 20 20 20 20 20 70 65 72 | 6c 20 2d 61 6e 65 20 27 | per|l -ane '|
|000013c0| 70 72 69 6e 74 20 70 6f | 70 28 40 46 29 2c 20 22 |print po|p(@F), "|
|000013d0| 5c 6e 22 3b 27 0d 0d 20 | 20 20 20 20 69 73 20 65 |\n";'.. | is e|
|000013e0| 71 75 69 76 61 6c 65 6e | 74 20 74 6f 0d 0d 20 20 |quivalen|t to.. |
|000013f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001400| 20 20 77 68 69 6c 65 20 | 28 3c 3e 29 20 7b 0d 20 | while |(<>) {. |
|00001410| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001420| 20 20 20 20 20 20 20 20 | 40 46 20 3d 20 73 70 6c | |@F = spl|
|00001430| 69 74 28 27 20 27 29 3b | 0d 20 20 20 20 20 20 20 |it(' ');|. |
|00001440| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001450| 20 20 70 72 69 6e 74 20 | 70 6f 70 28 40 46 29 2c | print |pop(@F),|
|00001460| 20 22 5c 6e 22 3b 0d 20 | 20 20 20 20 20 20 20 20 | "\n";. | |
|00001470| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0d 0d 0d 2d | | }...-|
|00001480| 63 20 20 20 63 61 75 73 | 65 73 20 70 65 72 6c 20 |c caus|es perl |
|00001490| 74 6f 20 63 68 65 63 6b | 20 74 68 65 20 73 79 6e |to check| the syn|
|000014a0| 74 61 78 20 6f 66 20 74 | 68 65 20 73 63 72 69 70 |tax of t|he scrip|
|000014b0| 74 20 61 6e 64 20 74 68 | 65 6e 20 65 78 69 74 0d |t and th|en exit.|
|000014c0| 20 20 20 20 20 77 69 74 | 68 6f 75 74 20 65 78 65 | wit|hout exe|
|000014d0| 63 75 74 69 6e 67 20 69 | 74 2e 0d 0d 2d 64 20 20 |cuting i|t...-d |
|000014e0| 20 72 75 6e 73 20 74 68 | 65 20 73 63 72 69 70 74 | runs th|e script|
|000014f0| 20 75 6e 64 65 72 20 74 | 68 65 20 70 65 72 6c 20 | under t|he perl |
|00001500| 64 65 62 75 67 67 65 72 | 2e 20 20 53 65 65 20 74 |debugger|. See t|
|00001510| 68 65 20 73 65 63 74 69 | 6f 6e 20 6f 6e 0d 20 20 |he secti|on on. |
|00001520| 20 20 20 44 65 62 75 67 | 67 69 6e 67 2e 0d 0d 2d | Debug|ging...-|
|00001530| 44 6e 75 6d 62 65 72 0d | 20 20 20 20 20 73 65 74 |Dnumber.| set|
|00001540| 73 20 64 65 62 75 67 67 | 69 6e 67 20 66 6c 61 67 |s debugg|ing flag|
|00001550| 73 2e 20 20 54 6f 20 77 | 61 74 63 68 20 68 6f 77 |s. To w|atch how|
|00001560| 20 69 74 20 65 78 65 63 | 75 74 65 73 20 79 6f 75 | it exec|utes you|
|00001570| 72 20 73 63 72 69 70 74 | 2c 0d 20 20 20 20 20 75 |r script|,. u|
|00001580| 73 65 20 2d 44 31 34 2e | 20 20 28 54 68 69 73 20 |se -D14.| (This |
|00001590| 6f 6e 6c 79 20 77 6f 72 | 6b 73 20 69 66 20 64 65 |only wor|ks if de|
|000015a0| 62 75 67 67 69 6e 67 20 | 69 73 20 63 6f 6d 70 69 |bugging |is compi|
|000015b0| 6c 65 64 20 69 6e 74 6f | 0d 20 20 20 20 20 79 6f |led into|. yo|
|000015c0| 75 72 20 70 65 72 6c 2e | 29 20 41 6e 6f 74 68 65 |ur perl.|) Anothe|
|000015d0| 72 20 6e 69 63 65 20 76 | 61 6c 75 65 20 69 73 20 |r nice v|alue is |
|000015e0| 2d 44 31 30 32 34 2c 20 | 77 68 69 63 68 20 6c 69 |-D1024, |which li|
|000015f0| 73 74 73 20 79 6f 75 72 | 0d 20 20 20 20 20 63 6f |sts your|. co|
|00001600| 6d 70 69 6c 65 64 20 73 | 79 6e 74 61 78 20 74 72 |mpiled s|yntax tr|
|00001610| 65 65 2e 20 20 41 6e 64 | 20 2d 44 35 31 32 20 64 |ee. And| -D512 d|
|00001620| 69 73 70 6c 61 79 73 20 | 63 6f 6d 70 69 6c 65 64 |isplays |compiled|
|00001630| 20 72 65 67 75 6c 61 72 | 0d 20 20 20 20 20 65 78 | regular|. ex|
|00001640| 70 72 65 73 73 69 6f 6e | 73 2e 0d 0d 2d 65 20 63 |pression|s...-e c|
|00001650| 6f 6d 6d 61 6e 64 6c 69 | 6e 65 0d 20 20 20 20 20 |ommandli|ne. |
|00001660| 6d 61 79 20 62 65 20 75 | 73 65 64 20 74 6f 20 65 |may be u|sed to e|
|00001670| 6e 74 65 72 20 6f 6e 65 | 20 6c 69 6e 65 20 6f 66 |nter one| line of|
|00001680| 20 73 63 72 69 70 74 2e | 20 20 4d 75 6c 74 69 70 | script.| Multip|
|00001690| 6c 65 20 2d 65 20 63 6f | 6d 2d 0d 20 20 20 20 20 |le -e co|m-. |
|000016a0| 6d 61 6e 64 73 20 6d 61 | 79 20 62 65 20 67 69 76 |mands ma|y be giv|
|000016b0| 65 6e 20 74 6f 20 62 75 | 69 6c 64 20 75 70 20 61 |en to bu|ild up a|
|000016c0| 20 6d 75 6c 74 69 2d 6c | 69 6e 65 20 73 63 72 69 | multi-l|ine scri|
|000016d0| 70 74 2e 20 20 49 66 20 | 2d 65 0d 20 20 20 20 20 |pt. If |-e. |
|000016e0| 69 73 20 67 69 76 65 6e | 2c 20 70 65 72 6c 20 77 |is given|, perl w|
|000016f0| 69 6c 6c 20 6e 6f 74 20 | 6c 6f 6f 6b 20 66 6f 72 |ill not |look for|
|00001700| 20 61 20 73 63 72 69 70 | 74 20 66 69 6c 65 6e 61 | a scrip|t filena|
|00001710| 6d 65 20 69 6e 20 74 68 | 65 0d 20 20 20 20 20 61 |me in th|e. a|
|00001720| 72 67 75 6d 65 6e 74 20 | 6c 69 73 74 2e 0d 0d 2d |rgument |list...-|
|00001730| 69 65 78 74 65 6e 73 69 | 6f 6e 0d 20 20 20 20 20 |iextensi|on. |
|00001740| 73 70 65 63 69 66 69 65 | 73 20 74 68 61 74 20 66 |specifie|s that f|
|00001750| 69 6c 65 73 20 70 72 6f | 63 65 73 73 65 64 20 62 |iles pro|cessed b|
|00001760| 79 20 74 68 65 20 3c 3e | 20 63 6f 6e 73 74 72 75 |y the <>| constru|
|00001770| 63 74 20 61 72 65 20 74 | 6f 20 62 65 0d 20 20 20 |ct are t|o be. |
|00001780| 20 20 65 64 69 74 65 64 | 20 69 6e 2d 70 6c 61 63 | edited| in-plac|
|00001790| 65 2e 20 20 49 74 20 64 | 6f 65 73 20 74 68 69 73 |e. It d|oes this|
|000017a0| 20 62 79 20 72 65 6e 61 | 6d 69 6e 67 20 74 68 65 | by rena|ming the|
|000017b0| 20 69 6e 70 75 74 20 66 | 69 6c 65 2c 0d 20 20 20 | input f|ile,. |
|000017c0| 20 20 6f 70 65 6e 69 6e | 67 20 74 68 65 20 6f 75 | openin|g the ou|
|000017d0| 74 70 75 74 20 66 69 6c | 65 20 62 79 20 74 68 65 |tput fil|e by the|
|000017e0| 20 73 61 6d 65 20 6e 61 | 6d 65 2c 20 61 6e 64 20 | same na|me, and |
|000017f0| 73 65 6c 65 63 74 69 6e | 67 20 74 68 61 74 0d 20 |selectin|g that. |
|00001800| 20 20 20 20 6f 75 74 70 | 75 74 20 66 69 6c 65 20 | outp|ut file |
|00001810| 61 73 20 74 68 65 20 64 | 65 66 61 75 6c 74 20 66 |as the d|efault f|
|00001820| 6f 72 20 70 72 69 6e 74 | 20 73 74 61 74 65 6d 65 |or print| stateme|
|00001830| 6e 74 73 2e 20 20 54 68 | 65 20 65 78 74 65 6e 2d |nts. Th|e exten-|
|00001840| 0d 20 20 20 20 20 73 69 | 6f 6e 2c 20 69 66 20 73 |. si|on, if s|
|00001850| 75 70 70 6c 69 65 64 2c | 20 69 73 20 61 64 64 65 |upplied,| is adde|
|00001860| 64 20 74 6f 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |d to the| name of|
|00001870| 20 74 68 65 20 6f 6c 64 | 20 66 69 6c 65 20 74 6f | the old| file to|
|00001880| 0d 20 20 20 20 20 6d 61 | 6b 65 20 61 20 62 61 63 |. ma|ke a bac|
|00001890| 6b 75 70 20 63 6f 70 79 | 2e 20 20 49 66 20 6e 6f |kup copy|. If no|
|000018a0| 20 65 78 74 65 6e 73 69 | 6f 6e 20 69 73 20 73 75 | extensi|on is su|
|000018b0| 70 70 6c 69 65 64 2c 20 | 6e 6f 20 62 61 63 6b 75 |pplied, |no backu|
|000018c0| 70 0d 20 20 20 20 20 69 | 73 20 6d 61 64 65 2e 20 |p. i|s made. |
|000018d0| 20 53 61 79 69 6e 67 20 | 22 70 65 72 6c 20 2d 70 | Saying |"perl -p|
|000018e0| 20 2d 69 2e 62 61 6b 20 | 2d 65 20 22 73 2f 66 6f | -i.bak |-e "s/fo|
|000018f0| 6f 2f 62 61 72 2f 3b 22 | 20 2e 2e 2e 20 22 20 69 |o/bar/;"| ... " i|
|00001900| 73 0d 20 20 20 20 20 74 | 68 65 20 73 61 6d 65 20 |s. t|he same |
|00001910| 61 73 20 75 73 69 6e 67 | 20 74 68 65 20 73 63 72 |as using| the scr|
|00001920| 69 70 74 3a 0d 0d 20 20 | 20 20 20 20 20 20 20 20 |ipt:.. | |
|00001930| 20 20 20 20 20 20 20 20 | 20 20 23 21 2f 75 73 72 | | #!/usr|
|00001940| 2f 62 69 6e 2f 70 65 72 | 6c 20 2d 70 69 2e 62 61 |/bin/per|l -pi.ba|
|00001950| 6b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |k. | |
|00001960| 20 20 20 20 20 20 73 2f | 66 6f 6f 2f 62 61 72 2f | s/|foo/bar/|
|00001970| 3b 0d 0d 20 20 20 20 20 | 77 68 69 63 68 20 69 73 |;.. |which is|
|00001980| 20 65 71 75 69 76 61 6c | 65 6e 74 20 74 6f 0d 0d | equival|ent to..|
|00001990| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000019a0| 20 20 20 20 23 21 2f 75 | 73 72 2f 62 69 6e 2f 70 | #!/u|sr/bin/p|
|000019b0| 65 72 6c 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |erl. | |
|000019c0| 20 20 20 20 20 20 20 20 | 77 68 69 6c 65 20 28 3c | |while (<|
|000019d0| 3e 29 20 7b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |>) {. | |
|000019e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 69 66 | | if|
|000019f0| 20 28 24 41 52 47 56 20 | 6e 65 20 24 6f 6c 64 61 | ($ARGV |ne $olda|
|00001a00| 72 67 76 29 20 7b 0d 20 | 20 20 20 20 20 20 20 20 |rgv) {. | |
|00001a10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a20| 20 20 20 20 20 72 65 6e | 61 6d 65 28 24 41 52 47 | ren|ame($ARG|
|00001a30| 56 2c 20 24 41 52 47 56 | 20 2e 20 27 2e 62 61 6b |V, $ARGV| . '.bak|
|00001a40| 27 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |');. | |
|00001a50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a60| 20 20 6f 70 65 6e 28 41 | 52 47 56 4f 55 54 2c 20 | open(A|RGVOUT, |
|00001a70| 22 3e 24 41 52 47 56 22 | 29 3b 0d 20 20 20 20 20 |">$ARGV"|);. |
|00001a80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a90| 20 20 20 20 20 20 20 20 | 20 73 65 6c 65 63 74 28 | | select(|
|00001aa0| 41 52 47 56 4f 55 54 29 | 3b 0d 20 20 20 20 20 20 |ARGVOUT)|;. |
|00001ab0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001ac0| 20 20 20 20 20 20 20 20 | 24 6f 6c 64 61 72 67 76 | |$oldargv|
|00001ad0| 20 3d 20 24 41 52 47 56 | 3b 0d 20 20 20 20 20 20 | = $ARGV|;. |
|00001ae0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001af0| 20 20 20 7d 0d 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00001b00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 73 2f | | s/|
|00001b10| 66 6f 6f 2f 62 61 72 2f | 3b 0d 20 20 20 20 20 20 |foo/bar/|;. |
|00001b20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7d 0d | | }.|
|00001b30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b40| 20 20 20 20 63 6f 6e 74 | 69 6e 75 65 20 7b 0d 20 | cont|inue {. |
|00001b50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b60| 20 20 20 20 70 72 69 6e | 74 3b 20 20 20 20 20 23 | prin|t; #|
|00001b70| 20 74 68 69 73 20 70 72 | 69 6e 74 73 20 74 6f 20 | this pr|ints to |
|00001b80| 6f 72 69 67 69 6e 61 6c | 20 66 69 6c 65 6e 61 6d |original| filenam|
|00001b90| 65 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e. | |
|00001ba0| 20 20 20 20 20 20 7d 0d | 20 20 20 20 20 20 20 20 | }.| |
|00001bb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 73 65 6c 65 | | sele|
|00001bc0| 63 74 28 53 54 44 4f 55 | 54 29 3b 0d 0d 20 20 20 |ct(STDOU|T);.. |
|00001bd0| 20 20 65 78 63 65 70 74 | 20 74 68 61 74 20 74 68 | except| that th|
|00001be0| 65 20 2d 69 20 66 6f 72 | 6d 20 64 6f 65 73 6e 27 |e -i for|m doesn'|
|00001bf0| 74 20 6e 65 65 64 20 74 | 6f 20 63 6f 6d 70 61 72 |t need t|o compar|
|00001c00| 65 20 24 41 52 47 56 20 | 74 6f 0d 20 20 20 20 20 |e $ARGV |to. |
|00001c10| 24 6f 6c 64 61 72 67 76 | 20 74 6f 20 6b 6e 6f 77 |$oldargv| to know|
|00001c20| 20 77 68 65 6e 20 74 68 | 65 20 66 69 6c 65 6e 61 | when th|e filena|
|00001c30| 6d 65 20 68 61 73 20 63 | 68 61 6e 67 65 64 2e 20 |me has c|hanged. |
|00001c40| 20 49 74 20 64 6f 65 73 | 2c 0d 20 20 20 20 20 68 | It does|,. h|
|00001c50| 6f 77 65 76 65 72 2c 20 | 75 73 65 20 41 52 47 56 |owever, |use ARGV|
|00001c60| 4f 55 54 20 66 6f 72 20 | 74 68 65 20 73 65 6c 65 |OUT for |the sele|
|00001c70| 63 74 65 64 20 66 69 6c | 65 68 61 6e 64 6c 65 2e |cted fil|ehandle.|
|00001c80| 20 20 4e 6f 74 65 20 74 | 68 61 74 0d 20 20 20 20 | Note t|hat. |
|00001c90| 20 53 54 44 4f 55 54 20 | 69 73 20 72 65 73 74 6f | STDOUT |is resto|
|00001ca0| 72 65 64 20 61 73 20 74 | 68 65 20 64 65 66 61 75 |red as t|he defau|
|00001cb0| 6c 74 20 6f 75 74 70 75 | 74 20 66 69 6c 65 68 61 |lt outpu|t fileha|
|00001cc0| 6e 64 6c 65 20 61 66 74 | 65 72 0d 20 20 20 20 20 |ndle aft|er. |
|00001cd0| 74 68 65 20 6c 6f 6f 70 | 2e 0d 0d 20 20 20 20 20 |the loop|... |
|00001ce0| 59 6f 75 20 63 61 6e 20 | 75 73 65 20 65 6f 66 20 |You can |use eof |
|00001cf0| 74 6f 20 6c 6f 63 61 74 | 65 20 74 68 65 20 65 6e |to locat|e the en|
|00001d00| 64 20 6f 66 20 65 61 63 | 68 20 69 6e 70 75 74 20 |d of eac|h input |
|00001d10| 66 69 6c 65 2c 20 69 6e | 0d 20 20 20 20 20 63 61 |file, in|. ca|
|00001d20| 73 65 20 79 6f 75 20 77 | 61 6e 74 20 74 6f 20 61 |se you w|ant to a|
|00001d30| 70 70 65 6e 64 20 74 6f | 20 65 61 63 68 20 66 69 |ppend to| each fi|
|00001d40| 6c 65 2c 20 6f 72 20 72 | 65 73 65 74 20 6c 69 6e |le, or r|eset lin|
|00001d50| 65 20 6e 75 6d 62 65 72 | 2d 0d 20 20 20 20 20 69 |e number|-. i|
|00001d60| 6e 67 20 28 73 65 65 20 | 65 78 61 6d 70 6c 65 20 |ng (see |example |
|00001d70| 75 6e 64 65 72 20 65 6f | 66 29 2e 0d 0d 2d 49 64 |under eo|f)...-Id|
|00001d80| 69 72 65 63 74 6f 72 79 | 0d 20 20 20 20 20 6d 61 |irectory|. ma|
|00001d90| 79 20 62 65 20 75 73 65 | 64 20 69 6e 20 63 6f 6e |y be use|d in con|
|00001da0| 6a 75 6e 63 74 69 6f 6e | 20 77 69 74 68 20 2d 50 |junction| with -P|
|00001db0| 20 74 6f 20 74 65 6c 6c | 20 74 68 65 20 43 20 70 | to tell| the C p|
|00001dc0| 72 65 70 72 6f 63 65 73 | 2d 0d 20 20 20 20 20 73 |reproces|-. s|
|00001dd0| 6f 72 20 77 68 65 72 65 | 20 74 6f 20 6c 6f 6f 6b |or where| to look|
|00001de0| 20 66 6f 72 20 69 6e 63 | 6c 75 64 65 20 66 69 6c | for inc|lude fil|
|00001df0| 65 73 2e 20 20 42 79 20 | 64 65 66 61 75 6c 74 0d |es. By |default.|
|00001e00| 20 20 20 20 20 2f 75 73 | 72 2f 69 6e 63 6c 75 64 | /us|r/includ|
|00001e10| 65 20 61 6e 64 20 2f 75 | 73 72 2f 6c 69 62 2f 70 |e and /u|sr/lib/p|
|00001e20| 65 72 6c 20 61 72 65 20 | 73 65 61 72 63 68 65 64 |erl are |searched|
|00001e30| 2e 0d 0d 2d 6c 6f 63 74 | 6e 75 6d 0d 20 20 20 20 |...-loct|num. |
|00001e40| 20 65 6e 61 62 6c 65 73 | 20 61 75 74 6f 6d 61 74 | enables| automat|
|00001e50| 69 63 20 6c 69 6e 65 2d | 65 6e 64 69 6e 67 20 70 |ic line-|ending p|
|00001e60| 72 6f 63 65 73 73 69 6e | 67 2e 20 20 49 74 20 68 |rocessin|g. It h|
|00001e70| 61 73 20 74 77 6f 0d 20 | 20 20 20 20 65 66 66 65 |as two. | effe|
|00001e80| 63 74 73 3a 20 66 69 72 | 73 74 2c 20 69 74 20 61 |cts: fir|st, it a|
|00001e90| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 20 63 68 6f |utomatic|ally cho|
|00001ea0| 70 73 20 74 68 65 20 6c | 69 6e 65 20 74 65 72 6d |ps the l|ine term|
|00001eb0| 69 6e 61 74 6f 72 0d 20 | 20 20 20 20 77 68 65 6e |inator. | when|
|00001ec0| 20 75 73 65 64 20 77 69 | 74 68 20 2d 6e 20 6f 72 | used wi|th -n or|
|00001ed0| 20 2d 70 20 2c 20 61 6e | 64 20 73 65 63 6f 6e 64 | -p , an|d second|
|00001ee0| 2c 20 69 74 20 61 73 73 | 69 67 6e 73 20 24 5c 20 |, it ass|igns $\ |
|00001ef0| 74 6f 20 68 61 76 65 0d | 20 20 20 20 20 74 68 65 |to have.| the|
|00001f00| 20 76 61 6c 75 65 20 6f | 66 20 6f 63 74 6e 75 6d | value o|f octnum|
|00001f10| 20 73 6f 20 74 68 61 74 | 20 61 6e 79 20 70 72 69 | so that| any pri|
|00001f20| 6e 74 20 73 74 61 74 65 | 6d 65 6e 74 73 20 77 69 |nt state|ments wi|
|00001f30| 6c 6c 20 68 61 76 65 0d | 20 20 20 20 20 74 68 61 |ll have.| tha|
|00001f40| 74 20 6c 69 6e 65 20 74 | 65 72 6d 69 6e 61 74 6f |t line t|erminato|
|00001f50| 72 20 61 64 64 65 64 20 | 62 61 63 6b 20 6f 6e 2e |r added |back on.|
|00001f60| 20 20 49 66 20 6f 63 74 | 6e 75 6d 20 69 73 20 6f | If oct|num is o|
|00001f70| 6d 69 74 74 65 64 2c 0d | 20 20 20 20 20 73 65 74 |mitted,.| set|
|00001f80| 73 20 24 5c 20 74 6f 20 | 74 68 65 20 63 75 72 72 |s $\ to |the curr|
|00001f90| 65 6e 74 20 76 61 6c 75 | 65 20 6f 66 20 24 2f 2e |ent valu|e of $/.|
|00001fa0| 20 20 46 6f 72 20 69 6e | 73 74 61 6e 63 65 2c 20 | For in|stance, |
|00001fb0| 74 6f 20 74 72 69 6d 0d | 20 20 20 20 20 6c 69 6e |to trim.| lin|
|00001fc0| 65 73 20 74 6f 20 38 30 | 20 63 6f 6c 75 6d 6e 73 |es to 80| columns|
|00001fd0| 3a 0d 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |:.. | |
|00001fe0| 20 20 20 20 20 20 20 70 | 65 72 6c 20 2d 6c 70 65 | p|erl -lpe|
|00001ff0| 20 27 73 75 62 73 74 72 | 28 24 5f 2c 20 38 30 29 | 'substr|($_, 80)|
|00002000| 20 3d 20 22 22 27 0d 0d | 20 20 20 20 20 4e 6f 74 | = ""'..| Not|
|00002010| 65 20 74 68 61 74 20 74 | 68 65 20 61 73 73 69 67 |e that t|he assig|
|00002020| 6e 6d 65 6e 74 20 24 5c | 20 3d 20 24 2f 20 69 73 |nment $\| = $/ is|
|00002030| 20 64 6f 6e 65 20 77 68 | 65 6e 20 74 68 65 20 73 | done wh|en the s|
|00002040| 77 69 74 63 68 20 69 73 | 0d 20 20 20 20 20 70 72 |witch is|. pr|
|00002050| 6f 63 65 73 73 65 64 2c | 20 73 6f 20 74 68 65 20 |ocessed,| so the |
|00002060| 69 6e 70 75 74 20 72 65 | 63 6f 72 64 20 73 65 70 |input re|cord sep|
|00002070| 61 72 61 74 6f 72 20 63 | 61 6e 20 62 65 20 64 69 |arator c|an be di|
|00002080| 66 66 65 72 65 6e 74 0d | 20 20 20 20 20 74 68 61 |fferent.| tha|
|00002090| 6e 20 74 68 65 20 6f 75 | 74 70 75 74 20 72 65 63 |n the ou|tput rec|
|000020a0| 6f 72 64 20 73 65 70 61 | 72 61 74 6f 72 20 69 66 |ord sepa|rator if|
|000020b0| 20 74 68 65 20 2d 6c 20 | 73 77 69 74 63 68 20 69 | the -l |switch i|
|000020c0| 73 20 66 6f 6c 2d 0d 20 | 20 20 20 20 6c 6f 77 65 |s fol-. | lowe|
|000020d0| 64 20 62 79 20 61 20 2d | 30 20 73 77 69 74 63 68 |d by a -|0 switch|
|000020e0| 3a 0d 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |:.. | |
|000020f0| 20 20 20 20 20 20 20 67 | 6e 75 66 69 6e 64 20 2f | g|nufind /|
|00002100| 20 2d 70 72 69 6e 74 30 | 20 7c 20 70 65 72 6c 20 | -print0| | perl |
|00002110| 2d 6c 6e 30 65 20 27 70 | 72 69 6e 74 20 22 66 6f |-ln0e 'p|rint "fo|
|00002120| 75 6e 64 20 24 5f 22 20 | 69 66 20 2d 70 27 0d 0d |und $_" |if -p'..|
|00002130| 20 20 20 20 20 54 68 69 | 73 20 73 65 74 73 20 24 | Thi|s sets $|
|00002140| 5c 20 74 6f 20 6e 65 77 | 6c 69 6e 65 20 61 6e 64 |\ to new|line and|
|00002150| 20 74 68 65 6e 20 73 65 | 74 73 20 24 2f 20 74 6f | then se|ts $/ to|
|00002160| 20 74 68 65 20 6e 75 6c | 6c 20 63 68 61 72 61 63 | the nul|l charac|
|00002170| 2d 0d 20 20 20 20 20 74 | 65 72 2e 0d 0d 2d 6e 20 |-. t|er...-n |
|00002180| 20 20 63 61 75 73 65 73 | 20 70 65 72 6c 20 74 6f | causes| perl to|
|00002190| 20 61 73 73 75 6d 65 20 | 74 68 65 20 66 6f 6c 6c | assume |the foll|
|000021a0| 6f 77 69 6e 67 20 6c 6f | 6f 70 20 61 72 6f 75 6e |owing lo|op aroun|
|000021b0| 64 20 79 6f 75 72 20 73 | 63 72 69 70 74 2c 0d 20 |d your s|cript,. |
|000021c0| 20 20 20 20 77 68 69 63 | 68 20 6d 61 6b 65 73 20 | whic|h makes |
|000021d0| 69 74 20 69 74 65 72 61 | 74 65 20 6f 76 65 72 20 |it itera|te over |
|000021e0| 66 69 6c 65 6e 61 6d 65 | 20 61 72 67 75 6d 65 6e |filename| argumen|
|000021f0| 74 73 20 73 6f 6d 65 77 | 68 61 74 20 6c 69 6b 65 |ts somew|hat like|
|00002200| 0d 20 20 20 20 20 22 73 | 65 64 20 2d 6e 22 20 6f |. "s|ed -n" o|
|00002210| 72 20 61 77 6b 3a 0d 0d | 20 20 20 20 20 20 20 20 |r awk:..| |
|00002220| 20 20 20 20 20 20 20 20 | 20 20 20 20 77 68 69 6c | | whil|
|00002230| 65 20 28 3c 3e 29 20 7b | 0d 20 20 20 20 20 20 20 |e (<>) {|. |
|00002240| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002250| 20 20 2e 2e 2e 20 20 20 | 20 20 20 20 23 20 79 6f | ... | # yo|
|00002260| 75 72 20 73 63 72 69 70 | 74 20 67 6f 65 73 20 68 |ur scrip|t goes h|
|00002270| 65 72 65 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ere. | |
|00002280| 20 20 20 20 20 20 20 20 | 7d 0d 0d 20 20 20 20 20 | |}.. |
|00002290| 4e 6f 74 65 20 74 68 61 | 74 20 74 68 65 20 6c 69 |Note tha|t the li|
|000022a0| 6e 65 73 20 61 72 65 20 | 6e 6f 74 20 70 72 69 6e |nes are |not prin|
|000022b0| 74 65 64 20 62 79 20 64 | 65 66 61 75 6c 74 2e 20 |ted by d|efault. |
|000022c0| 20 53 65 65 20 2d 70 20 | 74 6f 0d 20 20 20 20 20 | See -p |to. |
|000022d0| 68 61 76 65 20 6c 69 6e | 65 73 20 70 72 69 6e 74 |have lin|es print|
|000022e0| 65 64 2e 20 20 48 65 72 | 65 20 69 73 20 61 6e 20 |ed. Her|e is an |
|000022f0| 65 66 66 69 63 69 65 6e | 74 20 77 61 79 20 74 6f |efficien|t way to|
|00002300| 20 64 65 6c 65 74 65 20 | 61 6c 6c 0d 20 20 20 20 | delete |all. |
|00002310| 20 66 69 6c 65 73 20 6f | 6c 64 65 72 20 74 68 61 | files o|lder tha|
|00002320| 6e 20 61 20 77 65 65 6b | 3a 0d 0d 20 20 20 20 20 |n a week|:.. |
|00002330| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 66 | | f|
|00002340| 69 6e 64 20 2e 20 2d 6d | 74 69 6d 65 20 2b 37 20 |ind . -m|time +7 |
|00002350| 2d 70 72 69 6e 74 20 7c | 20 70 65 72 6c 20 2d 6e |-print || perl -n|
|00002360| 6c 65 20 27 75 6e 6c 69 | 6e 6b 3b 27 0d 0d 20 20 |le 'unli|nk;'.. |
|00002370| 20 20 20 54 68 69 73 20 | 69 73 20 66 61 73 74 65 | This |is faste|
|00002380| 72 20 74 68 61 6e 20 75 | 73 69 6e 67 20 74 68 65 |r than u|sing the|
|00002390| 20 2d 65 78 65 63 20 73 | 77 69 74 63 68 20 6f 66 | -exec s|witch of|
|000023a0| 20 66 69 6e 64 20 62 65 | 63 61 75 73 65 0d 20 20 | find be|cause. |
|000023b0| 20 20 20 79 6f 75 20 64 | 6f 6e 27 74 20 68 61 76 | you d|on't hav|
|000023c0| 65 20 74 6f 20 73 74 61 | 72 74 20 61 20 70 72 6f |e to sta|rt a pro|
|000023d0| 63 65 73 73 20 6f 6e 20 | 65 76 65 72 79 20 66 69 |cess on |every fi|
|000023e0| 6c 65 6e 61 6d 65 20 66 | 6f 75 6e 64 2e 0d 0d 2d |lename f|ound...-|
|000023f0| 70 20 20 20 63 61 75 73 | 65 73 20 70 65 72 6c 20 |p caus|es perl |
|00002400| 74 6f 20 61 73 73 75 6d | 65 20 74 68 65 20 66 6f |to assum|e the fo|
|00002410| 6c 6c 6f 77 69 6e 67 20 | 6c 6f 6f 70 20 61 72 6f |llowing |loop aro|
|00002420| 75 6e 64 20 79 6f 75 72 | 20 73 63 72 69 70 74 2c |und your| script,|
|00002430| 0d 20 20 20 20 20 77 68 | 69 63 68 20 6d 61 6b 65 |. wh|ich make|
|00002440| 73 20 69 74 20 69 74 65 | 72 61 74 65 20 6f 76 65 |s it ite|rate ove|
|00002450| 72 20 66 69 6c 65 6e 61 | 6d 65 20 61 72 67 75 6d |r filena|me argum|
|00002460| 65 6e 74 73 20 73 6f 6d | 65 77 68 61 74 20 6c 69 |ents som|ewhat li|
|00002470| 6b 65 0d 20 20 20 20 20 | 73 65 64 3a 0d 0d 20 20 |ke. |sed:.. |
|00002480| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002490| 20 20 77 68 69 6c 65 20 | 28 3c 3e 29 20 7b 0d 20 | while |(<>) {. |
|000024a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000024b0| 20 20 20 20 20 20 20 20 | 2e 2e 2e 20 20 20 20 20 | |... |
|000024c0| 20 20 23 20 79 6f 75 72 | 20 73 63 72 69 70 74 20 | # your| script |
|000024d0| 67 6f 65 73 20 68 65 72 | 65 0d 20 20 20 20 20 20 |goes her|e. |
|000024e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7d 20 | | } |
|000024f0| 63 6f 6e 74 69 6e 75 65 | 20 7b 0d 20 20 20 20 20 |continue| {. |
|00002500| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002510| 20 20 20 20 70 72 69 6e | 74 3b 0d 20 20 20 20 20 | prin|t;. |
|00002520| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7d | | }|
|00002530| 0d 0d 20 20 20 20 20 4e | 6f 74 65 20 74 68 61 74 |.. N|ote that|
|00002540| 20 74 68 65 20 6c 69 6e | 65 73 20 61 72 65 20 70 | the lin|es are p|
|00002550| 72 69 6e 74 65 64 20 61 | 75 74 6f 6d 61 74 69 63 |rinted a|utomatic|
|00002560| 61 6c 6c 79 2e 20 20 54 | 6f 20 73 75 70 70 72 65 |ally. T|o suppre|
|00002570| 73 73 0d 20 20 20 20 20 | 70 72 69 6e 74 69 6e 67 |ss. |printing|
|00002580| 20 75 73 65 20 74 68 65 | 20 2d 6e 20 73 77 69 74 | use the| -n swit|
|00002590| 63 68 2e 20 20 41 20 2d | 70 20 6f 76 65 72 72 69 |ch. A -|p overri|
|000025a0| 64 65 73 20 61 20 2d 6e | 20 73 77 69 74 63 68 2e |des a -n| switch.|
|000025b0| 0d 0d 2d 50 20 20 20 63 | 61 75 73 65 73 20 79 6f |..-P c|auses yo|
|000025c0| 75 72 20 73 63 72 69 70 | 74 20 74 6f 20 62 65 20 |ur scrip|t to be |
|000025d0| 72 75 6e 20 74 68 72 6f | 75 67 68 20 74 68 65 20 |run thro|ugh the |
|000025e0| 43 20 70 72 65 70 72 6f | 63 65 73 73 6f 72 0d 20 |C prepro|cessor. |
|000025f0| 20 20 20 20 62 65 66 6f | 72 65 20 63 6f 6d 70 69 | befo|re compi|
|00002600| 6c 61 74 69 6f 6e 20 62 | 79 20 70 65 72 6c 2e 20 |lation b|y perl. |
|00002610| 20 28 53 69 6e 63 65 20 | 62 6f 74 68 20 63 6f 6d | (Since |both com|
|00002620| 6d 65 6e 74 73 20 61 6e | 64 20 63 70 70 0d 20 20 |ments an|d cpp. |
|00002630| 20 20 20 64 69 72 65 63 | 74 69 76 65 73 20 62 65 | direc|tives be|
|00002640| 67 69 6e 20 77 69 74 68 | 20 74 68 65 20 23 20 63 |gin with| the # c|
|00002650| 68 61 72 61 63 74 65 72 | 2c 20 79 6f 75 20 73 68 |haracter|, you sh|
|00002660| 6f 75 6c 64 20 61 76 6f | 69 64 0d 20 20 20 20 20 |ould avo|id. |
|00002670| 73 74 61 72 74 69 6e 67 | 20 63 6f 6d 6d 65 6e 74 |starting| comment|
|00002680| 73 20 77 69 74 68 20 61 | 6e 79 20 77 6f 72 64 73 |s with a|ny words|
|00002690| 20 72 65 63 6f 67 6e 69 | 7a 65 64 20 62 79 20 74 | recogni|zed by t|
|000026a0| 68 65 20 43 20 70 72 65 | 70 72 6f 2d 0d 20 20 20 |he C pre|pro-. |
|000026b0| 20 20 63 65 73 73 6f 72 | 20 73 75 63 68 20 61 73 | cessor| such as|
|000026c0| 20 22 69 66 22 2c 20 22 | 65 6c 73 65 22 20 6f 72 | "if", "|else" or|
|000026d0| 20 22 64 65 66 69 6e 65 | 22 2e 29 0d 0d 2d 73 20 | "define|".)..-s |
|000026e0| 20 20 65 6e 61 62 6c 65 | 73 20 73 6f 6d 65 20 72 | enable|s some r|
|000026f0| 75 64 69 6d 65 6e 74 61 | 72 79 20 73 77 69 74 63 |udimenta|ry switc|
|00002700| 68 20 70 61 72 73 69 6e | 67 20 66 6f 72 20 73 77 |h parsin|g for sw|
|00002710| 69 74 63 68 65 73 20 6f | 6e 20 74 68 65 0d 20 20 |itches o|n the. |
|00002720| 20 20 20 63 6f 6d 6d 61 | 6e 64 20 6c 69 6e 65 20 | comma|nd line |
|00002730| 61 66 74 65 72 20 74 68 | 65 20 73 63 72 69 70 74 |after th|e script|
|00002740| 20 6e 61 6d 65 20 62 75 | 74 20 62 65 66 6f 72 65 | name bu|t before|
|00002750| 20 61 6e 79 20 66 69 6c | 65 6e 61 6d 65 0d 20 20 | any fil|ename. |
|00002760| 20 20 20 61 72 67 75 6d | 65 6e 74 73 20 28 6f 72 | argum|ents (or|
|00002770| 20 62 65 66 6f 72 65 20 | 61 20 2d 2d 29 2e 20 20 | before |a --). |
|00002780| 41 6e 79 20 73 77 69 74 | 63 68 20 66 6f 75 6e 64 |Any swit|ch found|
|00002790| 20 74 68 65 72 65 20 69 | 73 0d 20 20 20 20 20 72 | there i|s. r|
|000027a0| 65 6d 6f 76 65 64 20 66 | 72 6f 6d 20 40 41 52 47 |emoved f|rom @ARG|
|000027b0| 56 20 61 6e 64 20 73 65 | 74 73 20 74 68 65 20 63 |V and se|ts the c|
|000027c0| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 20 76 61 72 |orrespon|ding var|
|000027d0| 69 61 62 6c 65 20 69 6e | 0d 20 20 20 20 20 74 68 |iable in|. th|
|000027e0| 65 20 70 65 72 6c 20 73 | 63 72 69 70 74 2e 20 20 |e perl s|cript. |
|000027f0| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 73 63 |The foll|owing sc|
|00002800| 72 69 70 74 20 70 72 69 | 6e 74 73 20 22 74 72 75 |ript pri|nts "tru|
|00002810| 65 22 20 69 66 20 61 6e | 64 0d 20 20 20 20 20 6f |e" if an|d. o|
|00002820| 6e 6c 79 20 69 66 20 74 | 68 65 20 73 63 72 69 70 |nly if t|he scrip|
|00002830| 74 20 69 73 20 69 6e 76 | 6f 6b 65 64 20 77 69 74 |t is inv|oked wit|
|00002840| 68 20 61 20 2d 78 79 7a | 20 73 77 69 74 63 68 2e |h a -xyz| switch.|
|00002850| 0d 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00002860| 20 20 20 20 20 20 23 21 | 2f 75 73 72 2f 62 69 6e | #!|/usr/bin|
|00002870| 2f 70 65 72 6c 20 2d 73 | 0d 20 20 20 20 20 20 20 |/perl -s|. |
|00002880| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 | | if |
|00002890| 28 24 78 79 7a 29 20 7b | 20 70 72 69 6e 74 20 22 |($xyz) {| print "|
|000028a0| 74 72 75 65 5c 6e 22 3b | 20 7d 0d 0d 0d 2d 53 20 |true\n";| }...-S |
|000028b0| 20 20 6d 61 6b 65 73 20 | 70 65 72 6c 20 75 73 65 | makes |perl use|
|000028c0| 20 74 68 65 20 50 41 54 | 48 20 65 6e 76 69 72 6f | the PAT|H enviro|
|000028d0| 6e 6d 65 6e 74 20 76 61 | 72 69 61 62 6c 65 20 74 |nment va|riable t|
|000028e0| 6f 20 73 65 61 72 63 68 | 20 66 6f 72 0d 20 20 20 |o search| for. |
|000028f0| 20 20 74 68 65 20 73 63 | 72 69 70 74 20 28 75 6e | the sc|ript (un|
|00002900| 6c 65 73 73 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |less the| name of|
|00002910| 20 74 68 65 20 73 63 72 | 69 70 74 20 73 74 61 72 | the scr|ipt star|
|00002920| 74 73 20 77 69 74 68 20 | 61 0d 20 20 20 20 20 73 |ts with |a. s|
|00002930| 6c 61 73 68 29 2e 20 20 | 54 79 70 69 63 61 6c 6c |lash). |Typicall|
|00002940| 79 20 74 68 69 73 20 69 | 73 20 75 73 65 64 20 74 |y this i|s used t|
|00002950| 6f 20 65 6d 75 6c 61 74 | 65 20 23 21 20 73 74 61 |o emulat|e #! sta|
|00002960| 72 74 75 70 20 6f 6e 0d | 20 20 20 20 20 6d 61 63 |rtup on.| mac|
|00002970| 68 69 6e 65 73 20 74 68 | 61 74 20 64 6f 6e 27 74 |hines th|at don't|
|00002980| 20 73 75 70 70 6f 72 74 | 20 23 21 2c 20 69 6e 20 | support| #!, in |
|00002990| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 6d 61 |the foll|owing ma|
|000029a0| 6e 6e 65 72 3a 0d 0d 20 | 20 20 20 20 20 20 20 20 |nner:.. | |
|000029b0| 20 20 20 20 20 20 20 20 | 20 20 20 23 21 2f 75 73 | | #!/us|
|000029c0| 72 2f 62 69 6e 2f 70 65 | 72 6c 0d 20 20 20 20 20 |r/bin/pe|rl. |
|000029d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 65 | | e|
|000029e0| 76 61 6c 20 22 65 78 65 | 63 20 2f 75 73 72 2f 62 |val "exe|c /usr/b|
|000029f0| 69 6e 2f 70 65 72 6c 20 | 2d 53 20 24 30 20 24 2a |in/perl |-S $0 $*|
|00002a00| 22 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |". | |
|00002a10| 20 20 20 20 20 20 20 20 | 20 20 20 69 66 20 24 72 | | if $r|
|00002a20| 75 6e 6e 69 6e 67 5f 75 | 6e 64 65 72 5f 73 6f 6d |unning_u|nder_som|
|00002a30| 65 5f 73 68 65 6c 6c 3b | 0d 0d 20 20 20 20 20 54 |e_shell;|.. T|
|00002a40| 68 65 20 73 79 73 74 65 | 6d 20 69 67 6e 6f 72 65 |he syste|m ignore|
|00002a50| 73 20 74 68 65 20 66 69 | 72 73 74 20 6c 69 6e 65 |s the fi|rst line|
|00002a60| 20 61 6e 64 20 66 65 65 | 64 73 20 74 68 65 20 73 | and fee|ds the s|
|00002a70| 63 72 69 70 74 20 74 6f | 0d 20 20 20 20 20 2f 62 |cript to|. /b|
|00002a80| 69 6e 2f 73 68 2c 20 77 | 68 69 63 68 20 70 72 6f |in/sh, w|hich pro|
|00002a90| 63 65 65 64 73 20 74 6f | 20 74 72 79 20 74 6f 20 |ceeds to| try to |
|00002aa0| 65 78 65 63 75 74 65 20 | 74 68 65 20 70 65 72 6c |execute |the perl|
|00002ab0| 20 73 63 72 69 70 74 20 | 61 73 0d 20 20 20 20 20 | script |as. |
|00002ac0| 61 20 73 68 65 6c 6c 20 | 73 63 72 69 70 74 2e 20 |a shell |script. |
|00002ad0| 20 54 68 65 20 73 68 65 | 6c 6c 20 65 78 65 63 75 | The she|ll execu|
|00002ae0| 74 65 73 20 74 68 65 20 | 73 65 63 6f 6e 64 20 6c |tes the |second l|
|00002af0| 69 6e 65 20 61 73 20 61 | 0d 20 20 20 20 20 6e 6f |ine as a|. no|
|00002b00| 72 6d 61 6c 20 73 68 65 | 6c 6c 20 63 6f 6d 6d 61 |rmal she|ll comma|
|00002b10| 6e 64 2c 20 61 6e 64 20 | 74 68 75 73 20 73 74 61 |nd, and |thus sta|
|00002b20| 72 74 73 20 75 70 20 74 | 68 65 20 70 65 72 6c 20 |rts up t|he perl |
|00002b30| 69 6e 74 65 72 2d 0d 20 | 20 20 20 20 70 72 65 74 |inter-. | pret|
|00002b40| 65 72 2e 20 20 4f 6e 20 | 73 6f 6d 65 20 73 79 73 |er. On |some sys|
|00002b50| 74 65 6d 73 20 24 30 20 | 64 6f 65 73 6e 27 74 20 |tems $0 |doesn't |
|00002b60| 61 6c 77 61 79 73 20 63 | 6f 6e 74 61 69 6e 20 74 |always c|ontain t|
|00002b70| 68 65 20 66 75 6c 6c 0d | 20 20 20 20 20 70 61 74 |he full.| pat|
|00002b80| 68 6e 61 6d 65 2c 20 73 | 6f 20 74 68 65 20 2d 53 |hname, s|o the -S|
|00002b90| 20 74 65 6c 6c 73 20 70 | 65 72 6c 20 74 6f 20 73 | tells p|erl to s|
|00002ba0| 65 61 72 63 68 20 66 6f | 72 20 74 68 65 20 73 63 |earch fo|r the sc|
|00002bb0| 72 69 70 74 20 69 66 0d | 20 20 20 20 20 6e 65 63 |ript if.| nec|
|00002bc0| 65 73 73 61 72 79 2e 20 | 20 41 66 74 65 72 20 70 |essary. | After p|
|00002bd0| 65 72 6c 20 6c 6f 63 61 | 74 65 73 20 74 68 65 20 |erl loca|tes the |
|00002be0| 73 63 72 69 70 74 2c 20 | 69 74 20 70 61 72 73 65 |script, |it parse|
|00002bf0| 73 20 74 68 65 0d 20 20 | 20 20 20 6c 69 6e 65 73 |s the. | lines|
|00002c00| 20 61 6e 64 20 69 67 6e | 6f 72 65 73 20 74 68 65 | and ign|ores the|
|00002c10| 6d 20 62 65 63 61 75 73 | 65 20 74 68 65 20 76 61 |m becaus|e the va|
|00002c20| 72 69 61 62 6c 65 0d 20 | 20 20 20 20 24 72 75 6e |riable. | $run|
|00002c30| 6e 69 6e 67 5f 75 6e 64 | 65 72 5f 73 6f 6d 65 5f |ning_und|er_some_|
|00002c40| 73 68 65 6c 6c 20 69 73 | 20 6e 65 76 65 72 20 74 |shell is| never t|
|00002c50| 72 75 65 2e 20 20 41 20 | 62 65 74 74 65 72 20 63 |rue. A |better c|
|00002c60| 6f 6e 73 74 72 75 63 74 | 0d 20 20 20 20 20 74 68 |onstruct|. th|
|00002c70| 61 6e 20 24 2a 20 77 6f | 75 6c 64 20 62 65 20 24 |an $* wo|uld be $|
|00002c80| 7b 31 2b 22 24 40 22 7d | 2c 20 77 68 69 63 68 20 |{1+"$@"}|, which |
|00002c90| 68 61 6e 64 6c 65 73 20 | 65 6d 62 65 64 64 65 64 |handles |embedded|
|00002ca0| 20 73 70 61 63 65 73 0d | 20 20 20 20 20 61 6e 64 | spaces.| and|
|00002cb0| 20 73 75 63 68 20 69 6e | 20 74 68 65 20 66 69 6c | such in| the fil|
|00002cc0| 65 6e 61 6d 65 73 2c 20 | 62 75 74 20 64 6f 65 73 |enames, |but does|
|00002cd0| 6e 27 74 20 77 6f 72 6b | 20 69 66 20 74 68 65 20 |n't work| if the |
|00002ce0| 73 63 72 69 70 74 20 69 | 73 0d 20 20 20 20 20 62 |script i|s. b|
|00002cf0| 65 69 6e 67 20 69 6e 74 | 65 72 70 72 65 74 65 64 |eing int|erpreted|
|00002d00| 20 62 79 20 63 73 68 2e | 20 20 49 6e 20 6f 72 64 | by csh.| In ord|
|00002d10| 65 72 20 74 6f 20 73 74 | 61 72 74 20 75 70 20 73 |er to st|art up s|
|00002d20| 68 20 72 61 74 68 65 72 | 0d 20 20 20 20 20 74 68 |h rather|. th|
|00002d30| 61 6e 20 63 73 68 2c 20 | 73 6f 6d 65 20 73 79 73 |an csh, |some sys|
|00002d40| 74 65 6d 73 20 6d 61 79 | 20 68 61 76 65 20 74 6f |tems may| have to|
|00002d50| 20 72 65 70 6c 61 63 65 | 20 74 68 65 20 23 21 20 | replace| the #! |
|00002d60| 6c 69 6e 65 20 77 69 74 | 68 0d 20 20 20 20 20 61 |line wit|h. a|
|00002d70| 20 6c 69 6e 65 20 63 6f | 6e 74 61 69 6e 69 6e 67 | line co|ntaining|
|00002d80| 20 6a 75 73 74 20 61 20 | 63 6f 6c 6f 6e 2c 20 77 | just a |colon, w|
|00002d90| 68 69 63 68 20 77 69 6c | 6c 20 62 65 20 70 6f 6c |hich wil|l be pol|
|00002da0| 69 74 65 6c 79 0d 20 20 | 20 20 20 69 67 6e 6f 72 |itely. | ignor|
|00002db0| 65 64 20 62 79 20 70 65 | 72 6c 2e 20 20 4f 74 68 |ed by pe|rl. Oth|
|00002dc0| 65 72 20 73 79 73 74 65 | 6d 73 20 63 61 6e 27 74 |er syste|ms can't|
|00002dd0| 20 63 6f 6e 74 72 6f 6c | 20 74 68 61 74 2c 20 61 | control| that, a|
|00002de0| 6e 64 20 6e 65 65 64 0d | 20 20 20 20 20 61 20 74 |nd need.| a t|
|00002df0| 6f 74 61 6c 6c 79 20 64 | 65 76 69 6f 75 73 20 63 |otally d|evious c|
|00002e00| 6f 6e 73 74 72 75 63 74 | 20 74 68 61 74 20 77 69 |onstruct| that wi|
|00002e10| 6c 6c 20 77 6f 72 6b 20 | 75 6e 64 65 72 20 61 6e |ll work |under an|
|00002e20| 79 20 6f 66 20 63 73 68 | 2c 0d 20 20 20 20 20 73 |y of csh|,. s|
|00002e30| 68 20 6f 72 20 70 65 72 | 6c 2c 20 73 75 63 68 20 |h or per|l, such |
|00002e40| 61 73 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |as the f|ollowing|
|00002e50| 3a 0d 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |:.. | |
|00002e60| 20 20 20 20 20 20 20 65 | 76 61 6c 20 27 28 65 78 | e|val '(ex|
|00002e70| 69 74 20 24 3f 30 29 27 | 20 26 26 20 65 76 61 6c |it $?0)'| && eval|
|00002e80| 20 27 65 78 65 63 20 2f | 75 73 72 2f 62 69 6e 2f | 'exec /|usr/bin/|
|00002e90| 70 65 72 6c 20 2d 53 20 | 24 30 20 24 7b 31 2b 22 |perl -S |$0 ${1+"|
|00002ea0| 24 40 22 7d 27 0d 20 20 | 20 20 20 20 20 20 20 20 |$@"}'. | |
|00002eb0| 20 20 20 20 20 20 20 20 | 20 20 26 20 65 76 61 6c | | & eval|
|00002ec0| 20 27 65 78 65 63 20 2f | 75 73 72 2f 62 69 6e 2f | 'exec /|usr/bin/|
|00002ed0| 70 65 72 6c 20 2d 53 20 | 24 30 20 24 61 72 67 76 |perl -S |$0 $argv|
|00002ee0| 3a 71 27 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |:q'. | |
|00002ef0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 | | if |
|00002f00| 30 3b 0d 0d 0d 2d 75 20 | 20 20 63 61 75 73 65 73 |0;...-u | causes|
|00002f10| 20 70 65 72 6c 20 74 6f | 20 64 75 6d 70 20 63 6f | perl to| dump co|
|00002f20| 72 65 20 61 66 74 65 72 | 20 63 6f 6d 70 69 6c 69 |re after| compili|
|00002f30| 6e 67 20 79 6f 75 72 20 | 73 63 72 69 70 74 2e 20 |ng your |script. |
|00002f40| 20 59 6f 75 0d 20 20 20 | 20 20 63 61 6e 20 74 68 | You. | can th|
|00002f50| 65 6e 20 74 61 6b 65 20 | 74 68 69 73 20 63 6f 72 |en take |this cor|
|00002f60| 65 20 64 75 6d 70 20 61 | 6e 64 20 74 75 72 6e 20 |e dump a|nd turn |
|00002f70| 69 74 20 69 6e 74 6f 20 | 61 6e 20 65 78 65 63 75 |it into |an execu|
|00002f80| 74 61 62 6c 65 0d 20 20 | 20 20 20 66 69 6c 65 20 |table. | file |
|00002f90| 62 79 20 75 73 69 6e 67 | 20 74 68 65 20 75 6e 64 |by using| the und|
|00002fa0| 75 6d 70 20 70 72 6f 67 | 72 61 6d 20 28 6e 6f 74 |ump prog|ram (not|
|00002fb0| 20 73 75 70 70 6c 69 65 | 64 29 2e 20 20 54 68 69 | supplie|d). Thi|
|00002fc0| 73 0d 20 20 20 20 20 73 | 70 65 65 64 73 20 73 74 |s. s|peeds st|
|00002fd0| 61 72 74 75 70 20 61 74 | 20 74 68 65 20 65 78 70 |artup at| the exp|
|00002fe0| 65 6e 73 65 20 6f 66 20 | 73 6f 6d 65 20 64 69 73 |ense of |some dis|
|00002ff0| 6b 20 73 70 61 63 65 20 | 28 77 68 69 63 68 20 79 |k space |(which y|
|00003000| 6f 75 0d 20 20 20 20 20 | 63 61 6e 20 6d 69 6e 69 |ou. |can mini|
|00003010| 6d 69 7a 65 20 62 79 20 | 73 74 72 69 70 70 69 6e |mize by |strippin|
|00003020| 67 20 74 68 65 20 65 78 | 65 63 75 74 61 62 6c 65 |g the ex|ecutable|
|00003030| 29 2e 20 20 28 53 74 69 | 6c 6c 2c 20 61 20 22 68 |). (Sti|ll, a "h|
|00003040| 65 6c 6c 6f 0d 20 20 20 | 20 20 77 6f 72 6c 64 22 |ello. | world"|
|00003050| 20 65 78 65 63 75 74 61 | 62 6c 65 20 63 6f 6d 65 | executa|ble come|
|00003060| 73 20 6f 75 74 20 74 6f | 20 61 62 6f 75 74 20 32 |s out to| about 2|
|00003070| 30 30 4b 20 6f 6e 20 6d | 79 20 6d 61 63 68 69 6e |00K on m|y machin|
|00003080| 65 2e 29 20 49 66 0d 20 | 20 20 20 20 79 6f 75 20 |e.) If. | you |
|00003090| 61 72 65 20 67 6f 69 6e | 67 20 74 6f 20 72 75 6e |are goin|g to run|
|000030a0| 20 79 6f 75 72 20 65 78 | 65 63 75 74 61 62 6c 65 | your ex|ecutable|
|000030b0| 20 61 73 20 61 20 73 65 | 74 2d 69 64 20 70 72 6f | as a se|t-id pro|
|000030c0| 67 72 61 6d 0d 20 20 20 | 20 20 74 68 65 6e 20 79 |gram. | then y|
|000030d0| 6f 75 20 73 68 6f 75 6c | 64 20 70 72 6f 62 61 62 |ou shoul|d probab|
|000030e0| 6c 79 20 63 6f 6d 70 69 | 6c 65 20 69 74 20 75 73 |ly compi|le it us|
|000030f0| 69 6e 67 20 74 61 69 6e | 74 70 65 72 6c 20 72 61 |ing tain|tperl ra|
|00003100| 74 68 65 72 0d 20 20 20 | 20 20 74 68 61 6e 20 6e |ther. | than n|
|00003110| 6f 72 6d 61 6c 20 70 65 | 72 6c 2e 20 20 49 66 20 |ormal pe|rl. If |
|00003120| 79 6f 75 20 77 61 6e 74 | 20 74 6f 20 65 78 65 63 |you want| to exec|
|00003130| 75 74 65 20 61 20 70 6f | 72 74 69 6f 6e 20 6f 66 |ute a po|rtion of|
|00003140| 20 79 6f 75 72 0d 20 20 | 20 20 20 73 63 72 69 70 | your. | scrip|
|00003150| 74 20 62 65 66 6f 72 65 | 20 64 75 6d 70 69 6e 67 |t before| dumping|
|00003160| 2c 20 75 73 65 20 74 68 | 65 20 64 75 6d 70 20 6f |, use th|e dump o|
|00003170| 70 65 72 61 74 6f 72 20 | 69 6e 73 74 65 61 64 2e |perator |instead.|
|00003180| 20 20 4e 6f 74 65 3a 0d | 20 20 20 20 20 61 76 61 | Note:.| ava|
|00003190| 69 6c 61 62 69 6c 69 74 | 79 20 6f 66 20 75 6e 64 |ilabilit|y of und|
|000031a0| 75 6d 70 20 69 73 20 70 | 6c 61 74 66 6f 72 6d 20 |ump is p|latform |
|000031b0| 73 70 65 63 69 66 69 63 | 20 61 6e 64 20 6d 61 79 |specific| and may|
|000031c0| 20 6e 6f 74 20 62 65 0d | 20 20 20 20 20 61 76 61 | not be.| ava|
|000031d0| 69 6c 61 62 6c 65 20 66 | 6f 72 20 61 20 73 70 65 |ilable f|or a spe|
|000031e0| 63 69 66 69 63 20 70 6f | 72 74 20 6f 66 20 70 65 |cific po|rt of pe|
|000031f0| 72 6c 2e 0d 0d 2d 55 20 | 20 20 61 6c 6c 6f 77 73 |rl...-U | allows|
|00003200| 20 70 65 72 6c 20 74 6f | 20 64 6f 20 75 6e 73 61 | perl to| do unsa|
|00003210| 66 65 20 6f 70 65 72 61 | 74 69 6f 6e 73 2e 20 20 |fe opera|tions. |
|00003220| 43 75 72 72 65 6e 74 6c | 79 20 74 68 65 20 6f 6e |Currentl|y the on|
|00003230| 6c 79 0d 20 20 20 20 20 | 22 75 6e 73 61 66 65 22 |ly. |"unsafe"|
|00003240| 20 6f 70 65 72 61 74 69 | 6f 6e 20 69 73 20 74 68 | operati|on is th|
|00003250| 65 20 75 6e 6c 69 6e 6b | 69 6e 67 20 6f 66 20 64 |e unlink|ing of d|
|00003260| 69 72 65 63 74 6f 72 69 | 65 73 20 77 68 69 6c 65 |irectori|es while|
|00003270| 0d 20 20 20 20 20 72 75 | 6e 6e 69 6e 67 20 61 73 |. ru|nning as|
|00003280| 20 73 75 70 65 72 75 73 | 65 72 2e 0d 0d 2d 76 20 | superus|er...-v |
|00003290| 20 20 70 72 69 6e 74 73 | 20 74 68 65 20 76 65 72 | prints| the ver|
|000032a0| 73 69 6f 6e 20 61 6e 64 | 20 70 61 74 63 68 6c 65 |sion and| patchle|
|000032b0| 76 65 6c 20 6f 66 20 79 | 6f 75 72 20 70 65 72 6c |vel of y|our perl|
|000032c0| 20 65 78 65 63 75 74 61 | 62 6c 65 2e 0d 0d 2d 77 | executa|ble...-w|
|000032d0| 20 20 20 70 72 69 6e 74 | 73 20 77 61 72 6e 69 6e | print|s warnin|
|000032e0| 67 73 20 61 62 6f 75 74 | 20 69 64 65 6e 74 69 66 |gs about| identif|
|000032f0| 69 65 72 73 20 74 68 61 | 74 20 61 72 65 20 6d 65 |iers tha|t are me|
|00003300| 6e 74 69 6f 6e 65 64 20 | 6f 6e 6c 79 0d 20 20 20 |ntioned |only. |
|00003310| 20 20 6f 6e 63 65 2c 20 | 61 6e 64 20 73 63 61 6c | once, |and scal|
|00003320| 61 72 20 76 61 72 69 61 | 62 6c 65 73 20 74 68 61 |ar varia|bles tha|
|00003330| 74 20 61 72 65 20 75 73 | 65 64 20 62 65 66 6f 72 |t are us|ed befor|
|00003340| 65 20 62 65 69 6e 67 20 | 73 65 74 2e 0d 20 20 20 |e being |set.. |
|00003350| 20 20 41 6c 73 6f 20 77 | 61 72 6e 73 20 61 62 6f | Also w|arns abo|
|00003360| 75 74 20 72 65 64 65 66 | 69 6e 65 64 20 73 75 62 |ut redef|ined sub|
|00003370| 72 6f 75 74 69 6e 65 73 | 2c 20 61 6e 64 20 72 65 |routines|, and re|
|00003380| 66 65 72 65 6e 63 65 73 | 20 74 6f 0d 20 20 20 20 |ferences| to. |
|00003390| 20 75 6e 64 65 66 69 6e | 65 64 20 66 69 6c 65 68 | undefin|ed fileh|
|000033a0| 61 6e 64 6c 65 73 20 6f | 72 20 66 69 6c 65 68 61 |andles o|r fileha|
|000033b0| 6e 64 6c 65 73 20 6f 70 | 65 6e 65 64 20 72 65 61 |ndles op|ened rea|
|000033c0| 64 6f 6e 6c 79 20 74 68 | 61 74 0d 20 20 20 20 20 |donly th|at. |
|000033d0| 79 6f 75 20 61 72 65 20 | 61 74 74 65 6d 70 74 69 |you are |attempti|
|000033e0| 6e 67 20 74 6f 20 77 72 | 69 74 65 20 6f 6e 2e 20 |ng to wr|ite on. |
|000033f0| 20 41 6c 73 6f 20 77 61 | 72 6e 73 20 79 6f 75 20 | Also wa|rns you |
|00003400| 69 66 20 79 6f 75 20 75 | 73 65 0d 20 20 20 20 20 |if you u|se. |
|00003410| 3d 3d 20 6f 6e 20 76 61 | 6c 75 65 73 20 74 68 61 |== on va|lues tha|
|00003420| 74 20 64 6f 6e 27 74 20 | 6c 6f 6f 6b 20 6c 69 6b |t don't |look lik|
|00003430| 65 20 6e 75 6d 62 65 72 | 73 2c 20 61 6e 64 20 69 |e number|s, and i|
|00003440| 66 20 79 6f 75 72 20 73 | 75 62 2d 0d 20 20 20 20 |f your s|ub-. |
|00003450| 20 72 6f 75 74 69 6e 65 | 73 20 72 65 63 75 72 73 | routine|s recurs|
|00003460| 65 20 6d 6f 72 65 20 74 | 68 61 6e 20 31 30 30 20 |e more t|han 100 |
|00003470| 64 65 65 70 2e 0d 0d 2d | 78 64 69 72 65 63 74 6f |deep...-|xdirecto|
|00003480| 72 79 0d 20 20 20 20 20 | 74 65 6c 6c 73 20 70 65 |ry. |tells pe|
|00003490| 72 6c 20 74 68 61 74 20 | 74 68 65 20 73 63 72 69 |rl that |the scri|
|000034a0| 70 74 20 69 73 20 65 6d | 62 65 64 64 65 64 20 69 |pt is em|bedded i|
|000034b0| 6e 20 61 20 6d 65 73 73 | 61 67 65 2e 20 20 4c 65 |n a mess|age. Le|
|000034c0| 61 64 2d 0d 20 20 20 20 | 20 69 6e 67 20 67 61 72 |ad-. | ing gar|
|000034d0| 62 61 67 65 20 77 69 6c | 6c 20 62 65 20 64 69 73 |bage wil|l be dis|
|000034e0| 63 61 72 64 65 64 20 75 | 6e 74 69 6c 20 74 68 65 |carded u|ntil the|
|000034f0| 20 66 69 72 73 74 20 6c | 69 6e 65 20 74 68 61 74 | first l|ine that|
|00003500| 0d 20 20 20 20 20 73 74 | 61 72 74 73 20 77 69 74 |. st|arts wit|
|00003510| 68 20 23 21 20 61 6e 64 | 20 63 6f 6e 74 61 69 6e |h #! and| contain|
|00003520| 73 20 74 68 65 20 73 74 | 72 69 6e 67 20 22 70 65 |s the st|ring "pe|
|00003530| 72 6c 22 2e 20 20 41 6e | 79 20 6d 65 61 6e 69 6e |rl". An|y meanin|
|00003540| 67 2d 0d 20 20 20 20 20 | 66 75 6c 20 73 77 69 74 |g-. |ful swit|
|00003550| 63 68 65 73 20 6f 6e 20 | 74 68 61 74 20 6c 69 6e |ches on |that lin|
|00003560| 65 20 77 69 6c 6c 20 62 | 65 20 61 70 70 6c 69 65 |e will b|e applie|
|00003570| 64 20 28 62 75 74 20 6f | 6e 6c 79 20 6f 6e 65 0d |d (but o|nly one.|
|00003580| 20 20 20 20 20 67 72 6f | 75 70 20 6f 66 20 73 77 | gro|up of sw|
|00003590| 69 74 63 68 65 73 2c 20 | 61 73 20 77 69 74 68 20 |itches, |as with |
|000035a0| 6e 6f 72 6d 61 6c 20 23 | 21 20 70 72 6f 63 65 73 |normal #|! proces|
|000035b0| 73 69 6e 67 29 2e 20 20 | 49 66 20 61 0d 20 20 20 |sing). |If a. |
|000035c0| 20 20 64 69 72 65 63 74 | 6f 72 79 20 6e 61 6d 65 | direct|ory name|
|000035d0| 20 69 73 20 73 70 65 63 | 69 66 69 65 64 2c 20 50 | is spec|ified, P|
|000035e0| 65 72 6c 20 77 69 6c 6c | 20 73 77 69 74 63 68 20 |erl will| switch |
|000035f0| 74 6f 20 74 68 61 74 20 | 64 69 72 65 63 2d 0d 20 |to that |direc-. |
|00003600| 20 20 20 20 74 6f 72 79 | 20 62 65 66 6f 72 65 20 | tory| before |
|00003610| 72 75 6e 6e 69 6e 67 20 | 74 68 65 20 73 63 72 69 |running |the scri|
|00003620| 70 74 2e 20 20 54 68 65 | 20 2d 78 20 73 77 69 74 |pt. The| -x swit|
|00003630| 63 68 20 6f 6e 6c 79 20 | 63 6f 6e 74 72 6f 6c 73 |ch only |controls|
|00003640| 0d 20 20 20 20 20 74 68 | 65 20 74 68 65 20 64 69 |. th|e the di|
|00003650| 73 70 6f 73 61 6c 20 6f | 66 20 6c 65 61 64 69 6e |sposal o|f leadin|
|00003660| 67 20 67 61 72 62 61 67 | 65 2e 20 20 54 68 65 20 |g garbag|e. The |
|00003670| 73 63 72 69 70 74 20 6d | 75 73 74 20 62 65 0d 20 |script m|ust be. |
|00003680| 20 20 20 20 74 65 72 6d | 69 6e 61 74 65 64 20 77 | term|inated w|
|00003690| 69 74 68 20 5f 5f 45 4e | 44 5f 5f 20 69 66 20 74 |ith __EN|D__ if t|
|000036a0| 68 65 72 65 20 69 73 20 | 74 72 61 69 6c 69 6e 67 |here is |trailing|
|000036b0| 20 67 61 72 62 61 67 65 | 20 74 6f 20 62 65 0d 20 | garbage| to be. |
|000036c0| 20 20 20 20 69 67 6e 6f | 72 65 64 20 28 74 68 65 | igno|red (the|
|000036d0| 20 73 63 72 69 70 74 20 | 63 61 6e 20 70 72 6f 63 | script |can proc|
|000036e0| 65 73 73 20 61 6e 79 20 | 6f 72 20 61 6c 6c 20 6f |ess any |or all o|
|000036f0| 66 20 74 68 65 20 74 72 | 61 69 6c 69 6e 67 0d 20 |f the tr|ailing. |
|00003700| 20 20 20 20 67 61 72 62 | 61 67 65 20 76 69 61 20 | garb|age via |
|00003710| 74 68 65 20 44 41 54 41 | 20 66 69 6c 65 68 61 6e |the DATA| filehan|
|00003720| 64 6c 65 20 69 66 20 64 | 65 73 69 72 65 64 29 2e |dle if d|esired).|
|00003730| 0d be 4b 59 20 50 65 72 | 6c c9 54 79 70 65 73 0d |..KY Per|l.Types.|
|00003740| be 43 20 50 65 72 6c 20 | 68 61 73 20 74 68 72 65 |.C Perl |has thre|
|00003750| 65 20 64 61 74 61 20 74 | 79 70 65 73 3a 20 73 63 |e data t|ypes: sc|
|00003760| 61 6c 61 72 73 2c 20 61 | 72 72 61 79 73 20 6f 66 |alars, a|rrays of|
|00003770| 20 73 63 61 6c 61 72 73 | 2c 20 61 6e 64 20 61 73 | scalars|, and as|
|00003780| 73 6f 2d 0d 63 69 61 74 | 69 76 65 20 61 72 72 61 |so-.ciat|ive arra|
|00003790| 79 73 20 6f 66 20 73 63 | 61 6c 61 72 73 2e 20 20 |ys of sc|alars. |
|000037a0| 4e 6f 72 6d 61 6c 20 61 | 72 72 61 79 73 20 61 72 |Normal a|rrays ar|
|000037b0| 65 20 69 6e 64 65 78 65 | 64 20 62 79 20 6e 75 6d |e indexe|d by num|
|000037c0| 62 65 72 2c 0d 61 6e 64 | 20 61 73 73 6f 63 69 61 |ber,.and| associa|
|000037d0| 74 69 76 65 20 61 72 72 | 61 79 73 20 62 79 20 73 |tive arr|ays by s|
|000037e0| 74 72 69 6e 67 2e 0d 0d | 54 68 65 20 69 6e 74 65 |tring...|The inte|
|000037f0| 72 70 72 65 74 61 74 69 | 6f 6e 20 6f 66 20 6f 70 |rpretati|on of op|
|00003800| 65 72 61 74 69 6f 6e 73 | 20 61 6e 64 20 76 61 6c |erations| and val|
|00003810| 75 65 73 20 69 6e 20 70 | 65 72 6c 20 73 6f 6d 65 |ues in p|erl some|
|00003820| 74 69 6d 65 73 0d 64 65 | 70 65 6e 64 73 20 6f 6e |times.de|pends on|
|00003830| 20 74 68 65 20 72 65 71 | 75 69 72 65 6d 65 6e 74 | the req|uirement|
|00003840| 73 20 6f 66 20 74 68 65 | 20 63 6f 6e 74 65 78 74 |s of the| context|
|00003850| 20 61 72 6f 75 6e 64 20 | 74 68 65 20 6f 70 65 72 | around |the oper|
|00003860| 61 74 69 6f 6e 0d 6f 72 | 20 76 61 6c 75 65 2e 20 |ation.or| value. |
|00003870| 20 54 68 65 72 65 20 61 | 72 65 20 74 68 72 65 65 | There a|re three|
|00003880| 20 6d 61 6a 6f 72 20 63 | 6f 6e 74 65 78 74 73 3a | major c|ontexts:|
|00003890| 20 73 74 72 69 6e 67 2c | 20 6e 75 6d 65 72 69 63 | string,| numeric|
|000038a0| 20 61 6e 64 0d 61 72 72 | 61 79 2e 20 20 43 65 72 | and.arr|ay. Cer|
|000038b0| 74 61 69 6e 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 |tain ope|rations |
|000038c0| 72 65 74 75 72 6e 20 61 | 72 72 61 79 20 76 61 6c |return a|rray val|
|000038d0| 75 65 73 20 69 6e 20 63 | 6f 6e 74 65 78 74 73 20 |ues in c|ontexts |
|000038e0| 77 61 6e 74 2d 0d 69 6e | 67 20 61 6e 20 61 72 72 |want-.in|g an arr|
|000038f0| 61 79 2c 20 61 6e 64 20 | 73 63 61 6c 61 72 20 76 |ay, and |scalar v|
|00003900| 61 6c 75 65 73 20 6f 74 | 68 65 72 77 69 73 65 2e |alues ot|herwise.|
|00003910| 20 20 28 49 66 20 74 68 | 69 73 20 69 73 20 74 72 | (If th|is is tr|
|00003920| 75 65 20 6f 66 0d 61 6e | 20 6f 70 65 72 61 74 69 |ue of.an| operati|
|00003930| 6f 6e 20 69 74 20 77 69 | 6c 6c 20 62 65 20 6d 65 |on it wi|ll be me|
|00003940| 6e 74 69 6f 6e 65 64 20 | 69 6e 20 74 68 65 20 64 |ntioned |in the d|
|00003950| 6f 63 75 6d 65 6e 74 61 | 74 69 6f 6e 20 66 6f 72 |ocumenta|tion for|
|00003960| 20 74 68 61 74 0d 6f 70 | 65 72 61 74 69 6f 6e 2e | that.op|eration.|
|00003970| 29 20 4f 70 65 72 61 74 | 69 6f 6e 73 20 77 68 69 |) Operat|ions whi|
|00003980| 63 68 20 72 65 74 75 72 | 6e 20 73 63 61 6c 61 72 |ch retur|n scalar|
|00003990| 73 20 64 6f 6e 27 74 20 | 63 61 72 65 20 77 68 65 |s don't |care whe|
|000039a0| 74 68 65 72 0d 74 68 65 | 20 63 6f 6e 74 65 78 74 |ther.the| context|
|000039b0| 20 69 73 20 6c 6f 6f 6b | 69 6e 67 20 66 6f 72 20 | is look|ing for |
|000039c0| 61 20 73 74 72 69 6e 67 | 20 6f 72 20 61 20 6e 75 |a string| or a nu|
|000039d0| 6d 62 65 72 2c 20 62 75 | 74 20 73 63 61 6c 61 72 |mber, bu|t scalar|
|000039e0| 20 76 61 72 69 2d 0d 61 | 62 6c 65 73 20 61 6e 64 | vari-.a|bles and|
|000039f0| 20 76 61 6c 75 65 73 20 | 61 72 65 20 69 6e 74 65 | values |are inte|
|00003a00| 72 70 72 65 74 65 64 20 | 61 73 20 73 74 72 69 6e |rpreted |as strin|
|00003a10| 67 73 20 6f 72 20 6e 75 | 6d 62 65 72 73 20 61 73 |gs or nu|mbers as|
|00003a20| 0d 61 70 70 72 6f 70 72 | 69 61 74 65 20 74 6f 20 |.appropr|iate to |
|00003a30| 74 68 65 20 63 6f 6e 74 | 65 78 74 2e 20 20 41 20 |the cont|ext. A |
|00003a40| 73 63 61 6c 61 72 20 69 | 73 20 69 6e 74 65 72 70 |scalar i|s interp|
|00003a50| 72 65 74 65 64 20 61 73 | 20 54 52 55 45 20 69 6e |reted as| TRUE in|
|00003a60| 0d 74 68 65 20 62 6f 6f | 6c 65 61 6e 20 73 65 6e |.the boo|lean sen|
|00003a70| 73 65 20 69 66 20 69 74 | 20 69 73 20 6e 6f 74 20 |se if it| is not |
|00003a80| 74 68 65 20 6e 75 6c 6c | 20 73 74 72 69 6e 67 20 |the null| string |
|00003a90| 6f 72 20 30 2e 20 20 42 | 6f 6f 6c 65 61 6e 73 0d |or 0. B|ooleans.|
|00003aa0| 72 65 74 75 72 6e 65 64 | 20 62 79 20 6f 70 65 72 |returned| by oper|
|00003ab0| 61 74 6f 72 73 20 61 72 | 65 20 31 20 66 6f 72 20 |ators ar|e 1 for |
|00003ac0| 74 72 75 65 20 61 6e 64 | 20 30 20 6f 72 20 27 27 |true and| 0 or ''|
|00003ad0| 20 28 74 68 65 20 6e 75 | 6c 6c 0d 73 74 72 69 6e | (the nu|ll.strin|
|00003ae0| 67 29 20 66 6f 72 20 66 | 61 6c 73 65 2e 0d 0d 54 |g) for f|alse...T|
|00003af0| 68 65 72 65 20 61 72 65 | 20 61 63 74 75 61 6c 6c |here are| actuall|
|00003b00| 79 20 74 77 6f 20 76 61 | 72 69 65 74 69 65 73 20 |y two va|rieties |
|00003b10| 6f 66 20 6e 75 6c 6c 20 | 73 74 72 69 6e 67 3a 20 |of null |string: |
|00003b20| 64 65 66 69 6e 65 64 20 | 61 6e 64 0d 75 6e 64 65 |defined |and.unde|
|00003b30| 66 69 6e 65 64 2e 20 20 | 55 6e 64 65 66 69 6e 65 |fined. |Undefine|
|00003b40| 64 20 6e 75 6c 6c 20 73 | 74 72 69 6e 67 73 20 61 |d null s|trings a|
|00003b50| 72 65 20 72 65 74 75 72 | 6e 65 64 20 77 68 65 6e |re retur|ned when|
|00003b60| 20 74 68 65 72 65 20 69 | 73 20 6e 6f 0d 72 65 61 | there i|s no.rea|
|00003b70| 6c 20 76 61 6c 75 65 20 | 66 6f 72 20 73 6f 6d 65 |l value |for some|
|00003b80| 74 68 69 6e 67 2c 20 73 | 75 63 68 20 61 73 20 77 |thing, s|uch as w|
|00003b90| 68 65 6e 20 74 68 65 72 | 65 20 77 61 73 20 61 6e |hen ther|e was an|
|00003ba0| 20 65 72 72 6f 72 2c 20 | 6f 72 20 61 74 0d 65 6e | error, |or at.en|
|00003bb0| 64 20 6f 66 20 66 69 6c | 65 2c 20 6f 72 20 77 68 |d of fil|e, or wh|
|00003bc0| 65 6e 20 79 6f 75 20 72 | 65 66 65 72 20 74 6f 20 |en you r|efer to |
|00003bd0| 61 6e 20 75 6e 69 6e 69 | 74 69 61 6c 69 7a 65 64 |an unini|tialized|
|00003be0| 20 76 61 72 69 61 62 6c | 65 20 6f 72 0d 65 6c 65 | variabl|e or.ele|
|00003bf0| 6d 65 6e 74 20 6f 66 20 | 61 6e 20 61 72 72 61 79 |ment of |an array|
|00003c00| 2e 20 20 41 6e 20 75 6e | 64 65 66 69 6e 65 64 20 |. An un|defined |
|00003c10| 6e 75 6c 6c 20 73 74 72 | 69 6e 67 20 6d 61 79 20 |null str|ing may |
|00003c20| 62 65 63 6f 6d 65 20 64 | 65 66 69 6e 65 64 0d 74 |become d|efined.t|
|00003c30| 68 65 20 66 69 72 73 74 | 20 74 69 6d 65 20 79 6f |he first| time yo|
|00003c40| 75 20 61 63 63 65 73 73 | 20 69 74 2c 20 62 75 74 |u access| it, but|
|00003c50| 20 70 72 69 6f 72 20 74 | 6f 20 74 68 61 74 20 79 | prior t|o that y|
|00003c60| 6f 75 20 63 61 6e 20 75 | 73 65 20 74 68 65 0d 64 |ou can u|se the.d|
|00003c70| 65 66 69 6e 65 64 28 29 | 20 6f 70 65 72 61 74 6f |efined()| operato|
|00003c80| 72 20 74 6f 20 64 65 74 | 65 72 6d 69 6e 65 20 77 |r to det|ermine w|
|00003c90| 68 65 74 68 65 72 20 74 | 68 65 20 76 61 6c 75 65 |hether t|he value|
|00003ca0| 20 69 73 20 64 65 66 69 | 6e 65 64 20 6f 72 0d 6e | is defi|ned or.n|
|00003cb0| 6f 74 2e 0d 0d 52 65 66 | 65 72 65 6e 63 65 73 20 |ot...Ref|erences |
|00003cc0| 74 6f 20 73 63 61 6c 61 | 72 20 76 61 72 69 61 62 |to scala|r variab|
|00003cd0| 6c 65 73 20 61 6c 77 61 | 79 73 20 62 65 67 69 6e |les alwa|ys begin|
|00003ce0| 20 77 69 74 68 20 27 24 | 27 2c 20 65 76 65 6e 20 | with '$|', even |
|00003cf0| 77 68 65 6e 0d 72 65 66 | 65 72 72 69 6e 67 20 74 |when.ref|erring t|
|00003d00| 6f 20 61 20 73 63 61 6c | 61 72 20 74 68 61 74 20 |o a scal|ar that |
|00003d10| 69 73 20 70 61 72 74 20 | 6f 66 20 61 6e 20 61 72 |is part |of an ar|
|00003d20| 72 61 79 2e 20 20 54 68 | 75 73 3a 0d 0d 20 20 20 |ray. Th|us:.. |
|00003d30| 20 20 20 20 20 20 20 24 | 64 61 79 73 20 20 20 20 | $|days |
|00003d40| 20 20 20 20 20 20 20 23 | 20 61 20 73 69 6d 70 6c | #| a simpl|
|00003d50| 65 20 73 63 61 6c 61 72 | 20 76 61 72 69 61 62 6c |e scalar| variabl|
|00003d60| 65 0d 20 20 20 20 20 20 | 20 20 20 20 24 64 61 79 |e. | $day|
|00003d70| 73 5b 32 38 5d 20 20 20 | 20 20 20 20 23 20 32 39 |s[28] | # 29|
|00003d80| 74 68 20 65 6c 65 6d 65 | 6e 74 20 6f 66 20 61 72 |th eleme|nt of ar|
|00003d90| 72 61 79 20 40 64 61 79 | 73 0d 20 20 20 20 20 20 |ray @day|s. |
|00003da0| 20 20 20 20 24 64 61 79 | 73 7b 27 46 65 62 27 7d | $day|s{'Feb'}|
|00003db0| 20 20 20 20 23 20 6f 6e | 65 20 76 61 6c 75 65 20 | # on|e value |
|00003dc0| 66 72 6f 6d 20 61 6e 20 | 61 73 73 6f 63 69 61 74 |from an |associat|
|00003dd0| 69 76 65 20 61 72 72 61 | 79 0d 20 20 20 20 20 20 |ive arra|y. |
|00003de0| 20 20 20 20 24 23 64 61 | 79 73 20 20 20 20 20 20 | $#da|ys |
|00003df0| 20 20 20 20 23 20 6c 61 | 73 74 20 69 6e 64 65 78 | # la|st index|
|00003e00| 20 6f 66 20 61 72 72 61 | 79 20 40 64 61 79 73 0d | of arra|y @days.|
|00003e10| 0d 62 75 74 20 65 6e 74 | 69 72 65 20 61 72 72 61 |.but ent|ire arra|
|00003e20| 79 73 20 6f 72 20 61 72 | 72 61 79 20 73 6c 69 63 |ys or ar|ray slic|
|00003e30| 65 73 20 61 72 65 20 64 | 65 6e 6f 74 65 64 20 62 |es are d|enoted b|
|00003e40| 79 20 27 40 27 3a 0d 0d | 20 20 20 20 20 20 20 20 |y '@':..| |
|00003e50| 20 20 40 64 61 79 73 20 | 20 20 20 20 20 20 20 20 | @days | |
|00003e60| 20 20 23 20 28 24 64 61 | 79 73 5b 30 5d 2c 20 24 | # ($da|ys[0], $|
|00003e70| 64 61 79 73 5b 31 5d 2c | 2e 2e 2e 20 24 64 61 79 |days[1],|... $day|
|00003e80| 73 5b 6e 5d 29 0d 20 20 | 20 20 20 20 20 20 20 20 |s[n]). | |
|00003e90| 40 64 61 79 73 5b 33 2c | 34 2c 35 5d 20 20 20 20 |@days[3,|4,5] |
|00003ea0| 23 20 73 61 6d 65 20 61 | 73 20 40 64 61 79 73 5b |# same a|s @days[|
|00003eb0| 33 2e 2e 35 5d 0d 20 20 | 20 20 20 20 20 20 20 20 |3..5]. | |
|00003ec0| 40 64 61 79 73 7b 27 61 | 27 2c 27 63 27 7d 20 20 |@days{'a|','c'} |
|00003ed0| 23 20 73 61 6d 65 20 61 | 73 20 28 24 64 61 79 73 |# same a|s ($days|
|00003ee0| 7b 27 61 27 7d 2c 24 64 | 61 79 73 7b 27 63 27 7d |{'a'},$d|ays{'c'}|
|00003ef0| 29 0d 0d 61 6e 64 20 65 | 6e 74 69 72 65 20 61 73 |)..and e|ntire as|
|00003f00| 73 6f 63 69 61 74 69 76 | 65 20 61 72 72 61 79 73 |sociativ|e arrays|
|00003f10| 20 61 72 65 20 64 65 6e | 6f 74 65 64 20 62 79 20 | are den|oted by |
|00003f20| 27 25 27 3a 0d 0d 20 20 | 20 20 20 20 20 20 20 20 |'%':.. | |
|00003f30| 25 64 61 79 73 20 20 20 | 20 20 20 20 20 20 20 20 |%days | |
|00003f40| 23 20 28 6b 65 79 31 2c | 20 76 61 6c 31 2c 20 6b |# (key1,| val1, k|
|00003f50| 65 79 32 2c 20 76 61 6c | 32 20 2e 2e 2e 29 0d 0d |ey2, val|2 ...)..|
|00003f60| 41 6e 79 20 6f 66 20 74 | 68 65 73 65 20 65 69 67 |Any of t|hese eig|
|00003f70| 68 74 20 63 6f 6e 73 74 | 72 75 63 74 73 20 6d 61 |ht const|ructs ma|
|00003f80| 79 20 73 65 72 76 65 20 | 61 73 20 61 6e 20 6c 76 |y serve |as an lv|
|00003f90| 61 6c 75 65 2c 20 74 68 | 61 74 20 69 73 2c 0d 6d |alue, th|at is,.m|
|00003fa0| 61 79 20 62 65 20 61 73 | 73 69 67 6e 65 64 20 74 |ay be as|signed t|
|00003fb0| 6f 2e 20 20 28 49 74 20 | 61 6c 73 6f 20 74 75 72 |o. (It |also tur|
|00003fc0| 6e 73 20 6f 75 74 20 74 | 68 61 74 20 61 6e 20 61 |ns out t|hat an a|
|00003fd0| 73 73 69 67 6e 6d 65 6e | 74 20 69 73 0d 69 74 73 |ssignmen|t is.its|
|00003fe0| 65 6c 66 20 61 6e 20 6c | 76 61 6c 75 65 20 69 6e |elf an l|value in|
|00003ff0| 20 63 65 72 74 61 69 6e | 20 63 6f 6e 74 65 78 74 | certain| context|
|00004000| 73 2d 2d 73 65 65 20 65 | 78 61 6d 70 6c 65 73 20 |s--see e|xamples |
|00004010| 75 6e 64 65 72 20 73 2c | 20 74 72 0d 61 6e 64 20 |under s,| tr.and |
|00004020| 63 68 6f 70 2e 29 20 41 | 73 73 69 67 6e 6d 65 6e |chop.) A|ssignmen|
|00004030| 74 20 74 6f 20 61 20 73 | 63 61 6c 61 72 20 65 76 |t to a s|calar ev|
|00004040| 61 6c 75 61 74 65 73 20 | 74 68 65 20 72 69 67 68 |aluates |the righ|
|00004050| 74 68 61 6e 64 20 73 69 | 64 65 20 69 6e 0d 61 20 |thand si|de in.a |
|00004060| 73 63 61 6c 61 72 20 63 | 6f 6e 74 65 78 74 2c 20 |scalar c|ontext, |
|00004070| 77 68 69 6c 65 20 61 73 | 73 69 67 6e 6d 65 6e 74 |while as|signment|
|00004080| 20 74 6f 20 61 6e 20 61 | 72 72 61 79 20 6f 72 20 | to an a|rray or |
|00004090| 61 72 72 61 79 20 73 6c | 69 63 65 0d 65 76 61 6c |array sl|ice.eval|
|000040a0| 75 61 74 65 73 20 74 68 | 65 20 72 69 67 68 74 68 |uates th|e righth|
|000040b0| 61 6e 64 20 73 69 64 65 | 20 69 6e 20 61 6e 20 61 |and side| in an a|
|000040c0| 72 72 61 79 20 63 6f 6e | 74 65 78 74 2e 0d 0d 59 |rray con|text...Y|
|000040d0| 6f 75 20 6d 61 79 20 66 | 69 6e 64 20 74 68 65 20 |ou may f|ind the |
|000040e0| 6c 65 6e 67 74 68 20 6f | 66 20 61 72 72 61 79 20 |length o|f array |
|000040f0| 40 64 61 79 73 20 62 79 | 20 65 76 61 6c 75 61 74 |@days by| evaluat|
|00004100| 69 6e 67 20 22 24 23 64 | 61 79 73 22 2c 20 61 73 |ing "$#d|ays", as|
|00004110| 0d 69 6e 20 63 73 68 2e | 20 20 28 41 63 74 75 61 |.in csh.| (Actua|
|00004120| 6c 6c 79 2c 20 69 74 27 | 73 20 6e 6f 74 20 74 68 |lly, it'|s not th|
|00004130| 65 20 6c 65 6e 67 74 68 | 20 6f 66 20 74 68 65 20 |e length| of the |
|00004140| 61 72 72 61 79 2c 20 69 | 74 27 73 20 74 68 65 0d |array, i|t's the.|
|00004150| 73 75 62 73 63 72 69 70 | 74 20 6f 66 20 74 68 65 |subscrip|t of the|
|00004160| 20 6c 61 73 74 20 65 6c | 65 6d 65 6e 74 2c 20 73 | last el|ement, s|
|00004170| 69 6e 63 65 20 74 68 65 | 72 65 20 69 73 20 28 6f |ince the|re is (o|
|00004180| 72 64 69 6e 61 72 69 6c | 79 29 20 61 20 30 74 68 |rdinaril|y) a 0th|
|00004190| 0d 65 6c 65 6d 65 6e 74 | 2e 29 20 41 73 73 69 67 |.element|.) Assig|
|000041a0| 6e 69 6e 67 20 74 6f 20 | 24 23 64 61 79 73 20 63 |ning to |$#days c|
|000041b0| 68 61 6e 67 65 73 20 74 | 68 65 20 6c 65 6e 67 74 |hanges t|he lengt|
|000041c0| 68 20 6f 66 20 74 68 65 | 20 61 72 72 61 79 2e 0d |h of the| array..|
|000041d0| 53 68 6f 72 74 65 6e 69 | 6e 67 20 61 6e 20 61 72 |Shorteni|ng an ar|
|000041e0| 72 61 79 20 62 79 20 74 | 68 69 73 20 6d 65 74 68 |ray by t|his meth|
|000041f0| 6f 64 20 64 6f 65 73 20 | 6e 6f 74 20 61 63 74 75 |od does |not actu|
|00004200| 61 6c 6c 79 20 64 65 73 | 74 72 6f 79 20 61 6e 79 |ally des|troy any|
|00004210| 0d 76 61 6c 75 65 73 2e | 20 20 4c 65 6e 67 74 68 |.values.| Length|
|00004220| 65 6e 69 6e 67 20 61 6e | 20 61 72 72 61 79 20 74 |ening an| array t|
|00004230| 68 61 74 20 77 61 73 20 | 70 72 65 76 69 6f 75 73 |hat was |previous|
|00004240| 6c 79 20 73 68 6f 72 74 | 65 6e 65 64 0d 72 65 63 |ly short|ened.rec|
|00004250| 6f 76 65 72 73 20 74 68 | 65 20 76 61 6c 75 65 73 |overs th|e values|
|00004260| 20 74 68 61 74 20 77 65 | 72 65 20 69 6e 20 74 68 | that we|re in th|
|00004270| 6f 73 65 20 65 6c 65 6d | 65 6e 74 73 2e 20 20 59 |ose elem|ents. Y|
|00004280| 6f 75 20 63 61 6e 20 61 | 6c 73 6f 0d 67 61 69 6e |ou can a|lso.gain|
|00004290| 20 73 6f 6d 65 20 6d 65 | 61 73 75 72 65 20 6f 66 | some me|asure of|
|000042a0| 20 65 66 66 69 63 69 65 | 6e 63 79 20 62 79 20 70 | efficie|ncy by p|
|000042b0| 72 65 65 78 74 65 6e 64 | 69 6e 67 20 61 6e 20 61 |reextend|ing an a|
|000042c0| 72 72 61 79 20 74 68 61 | 74 20 69 73 0d 67 6f 69 |rray tha|t is.goi|
|000042d0| 6e 67 20 74 6f 20 67 65 | 74 20 62 69 67 2e 20 20 |ng to ge|t big. |
|000042e0| 28 59 6f 75 20 63 61 6e | 20 61 6c 73 6f 20 65 78 |(You can| also ex|
|000042f0| 74 65 6e 64 20 61 6e 20 | 61 72 72 61 79 20 62 79 |tend an |array by|
|00004300| 20 61 73 73 69 67 6e 69 | 6e 67 20 74 6f 0d 61 6e | assigni|ng to.an|
|00004310| 20 65 6c 65 6d 65 6e 74 | 20 74 68 61 74 20 69 73 | element| that is|
|00004320| 20 6f 66 66 20 74 68 65 | 20 65 6e 64 20 6f 66 20 | off the| end of |
|00004330| 74 68 65 20 61 72 72 61 | 79 2e 20 20 54 68 69 73 |the arra|y. This|
|00004340| 20 64 69 66 66 65 72 73 | 20 66 72 6f 6d 0d 61 73 | differs| from.as|
|00004350| 73 69 67 6e 69 6e 67 20 | 74 6f 20 24 23 77 68 61 |signing |to $#wha|
|00004360| 74 65 76 65 72 20 69 6e | 20 74 68 61 74 20 69 6e |tever in| that in|
|00004370| 74 65 72 76 65 6e 69 6e | 67 20 76 61 6c 75 65 73 |tervenin|g values|
|00004380| 20 61 72 65 20 73 65 74 | 20 74 6f 0d 6e 75 6c 6c | are set| to.null|
|00004390| 20 72 61 74 68 65 72 20 | 74 68 61 6e 20 72 65 63 | rather |than rec|
|000043a0| 6f 76 65 72 65 64 2e 29 | 20 59 6f 75 20 63 61 6e |overed.)| You can|
|000043b0| 20 74 72 75 6e 63 61 74 | 65 20 61 6e 20 61 72 72 | truncat|e an arr|
|000043c0| 61 79 20 64 6f 77 6e 20 | 74 6f 0d 6e 6f 74 68 69 |ay down |to.nothi|
|000043d0| 6e 67 20 62 79 20 61 73 | 73 69 67 6e 69 6e 67 20 |ng by as|signing |
|000043e0| 74 68 65 20 6e 75 6c 6c | 20 6c 69 73 74 20 28 29 |the null| list ()|
|000043f0| 20 74 6f 20 69 74 2e 20 | 20 54 68 65 20 66 6f 6c | to it. | The fol|
|00004400| 6c 6f 77 69 6e 67 20 61 | 72 65 0d 65 78 61 63 74 |lowing a|re.exact|
|00004410| 6c 79 20 65 71 75 69 76 | 61 6c 65 6e 74 0d 0d 20 |ly equiv|alent.. |
|00004420| 20 20 20 20 40 77 68 61 | 74 65 76 65 72 20 3d 20 | @wha|tever = |
|00004430| 28 29 3b 0d 20 20 20 20 | 20 24 23 77 68 61 74 65 |();. | $#whate|
|00004440| 76 65 72 20 3d 20 24 5b | 20 2d 20 31 3b 0d 0d 0d |ver = $[| - 1;...|
|00004450| 49 66 20 79 6f 75 20 65 | 76 61 6c 75 61 74 65 20 |If you e|valuate |
|00004460| 61 6e 20 61 72 72 61 79 | 20 69 6e 20 61 20 73 63 |an array| in a sc|
|00004470| 61 6c 61 72 20 63 6f 6e | 74 65 78 74 2c 20 69 74 |alar con|text, it|
|00004480| 20 72 65 74 75 72 6e 73 | 20 74 68 65 0d 6c 65 6e | returns| the.len|
|00004490| 67 74 68 20 6f 66 20 74 | 68 65 20 61 72 72 61 79 |gth of t|he array|
|000044a0| 2e 20 20 54 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |. The f|ollowing|
|000044b0| 20 69 73 20 61 6c 77 61 | 79 73 20 74 72 75 65 3a | is alwa|ys true:|
|000044c0| 0d 0d 20 20 20 20 20 73 | 63 61 6c 61 72 28 40 77 |.. s|calar(@w|
|000044d0| 68 61 74 65 76 65 72 29 | 20 3d 3d 20 24 23 77 68 |hatever)| == $#wh|
|000044e0| 61 74 65 76 65 72 20 2d | 20 24 5b 20 2b 20 31 3b |atever -| $[ + 1;|
|000044f0| 0d 0d 49 66 20 79 6f 75 | 20 65 76 61 6c 75 61 74 |..If you| evaluat|
|00004500| 65 20 61 6e 20 61 73 73 | 6f 63 69 61 74 69 76 65 |e an ass|ociative|
|00004510| 20 61 72 72 61 79 20 69 | 6e 20 61 20 73 63 61 6c | array i|n a scal|
|00004520| 61 72 20 63 6f 6e 74 65 | 78 74 2c 20 69 74 20 72 |ar conte|xt, it r|
|00004530| 65 74 75 72 6e 73 0d 61 | 20 76 61 6c 75 65 20 77 |eturns.a| value w|
|00004540| 68 69 63 68 20 69 73 20 | 74 72 75 65 20 69 66 20 |hich is |true if |
|00004550| 61 6e 64 20 6f 6e 6c 79 | 20 69 66 20 74 68 65 20 |and only| if the |
|00004560| 61 72 72 61 79 20 63 6f | 6e 74 61 69 6e 73 20 61 |array co|ntains a|
|00004570| 6e 79 20 65 6c 65 6d 65 | 6e 74 73 2e 0d 28 49 66 |ny eleme|nts..(If|
|00004580| 20 74 68 65 72 65 20 61 | 72 65 20 61 6e 79 20 65 | there a|re any e|
|00004590| 6c 65 6d 65 6e 74 73 2c | 20 74 68 65 20 76 61 6c |lements,| the val|
|000045a0| 75 65 20 72 65 74 75 72 | 6e 65 64 20 69 73 20 61 |ue retur|ned is a|
|000045b0| 20 73 74 72 69 6e 67 20 | 63 6f 6e 73 69 73 74 69 | string |consisti|
|000045c0| 6e 67 0d 6f 66 20 74 68 | 65 20 6e 75 6d 62 65 72 |ng.of th|e number|
|000045d0| 20 6f 66 20 75 73 65 64 | 20 62 75 63 6b 65 74 73 | of used| buckets|
|000045e0| 20 61 6e 64 20 74 68 65 | 20 6e 75 6d 62 65 72 20 | and the| number |
|000045f0| 6f 66 20 61 6c 6c 6f 63 | 61 74 65 64 20 62 75 63 |of alloc|ated buc|
|00004600| 6b 65 74 73 2c 20 0d 73 | 65 70 61 72 61 74 65 64 |kets, .s|eparated|
|00004610| 20 62 79 20 61 20 73 6c | 61 73 68 2e 29 0d 0d 4d | by a sl|ash.)..M|
|00004620| 75 6c 74 69 2d 64 69 6d | 65 6e 73 69 6f 6e 61 6c |ulti-dim|ensional|
|00004630| 20 61 72 72 61 79 73 20 | 61 72 65 20 6e 6f 74 20 | arrays |are not |
|00004640| 64 69 72 65 63 74 6c 79 | 20 73 75 70 70 6f 72 74 |directly| support|
|00004650| 65 64 2c 20 62 75 74 20 | 73 65 65 20 74 68 65 0d |ed, but |see the.|
|00004660| 64 69 73 63 75 73 73 69 | 6f 6e 20 6f 66 20 74 68 |discussi|on of th|
|00004670| 65 20 24 3b 20 76 61 72 | 69 61 62 6c 65 20 6c 61 |e $; var|iable la|
|00004680| 74 65 72 20 66 6f 72 20 | 61 20 6d 65 61 6e 73 20 |ter for |a means |
|00004690| 6f 66 20 65 6d 75 6c 61 | 74 69 6e 67 20 6d 75 6c |of emula|ting mul|
|000046a0| 2d 0d 74 69 70 6c 65 20 | 73 75 62 73 63 72 69 70 |-.tiple |subscrip|
|000046b0| 74 73 20 77 69 74 68 20 | 61 6e 20 61 73 73 6f 63 |ts with |an assoc|
|000046c0| 69 61 74 69 76 65 20 61 | 72 72 61 79 2e 20 20 59 |iative a|rray. Y|
|000046d0| 6f 75 20 63 6f 75 6c 64 | 20 61 6c 73 6f 20 77 72 |ou could| also wr|
|000046e0| 69 74 65 0d 61 20 73 75 | 62 72 6f 75 74 69 6e 65 |ite.a su|broutine|
|000046f0| 20 74 6f 20 74 75 72 6e | 20 6d 75 6c 74 69 70 6c | to turn| multipl|
|00004700| 65 20 73 75 62 73 63 72 | 69 70 74 73 20 69 6e 74 |e subscr|ipts int|
|00004710| 6f 20 61 20 73 69 6e 67 | 6c 65 20 73 75 62 73 63 |o a sing|le subsc|
|00004720| 72 69 70 74 2e 0d 0d 45 | 76 65 72 79 20 64 61 74 |ript...E|very dat|
|00004730| 61 20 74 79 70 65 20 68 | 61 73 20 69 74 73 20 6f |a type h|as its o|
|00004740| 77 6e 20 6e 61 6d 65 73 | 70 61 63 65 2e 20 20 59 |wn names|pace. Y|
|00004750| 6f 75 20 63 61 6e 2c 20 | 77 69 74 68 6f 75 74 20 |ou can, |without |
|00004760| 66 65 61 72 20 6f 66 0d | 63 6f 6e 66 6c 69 63 74 |fear of.|conflict|
|00004770| 2c 20 75 73 65 20 74 68 | 65 20 73 61 6d 65 20 6e |, use th|e same n|
|00004780| 61 6d 65 20 66 6f 72 20 | 61 20 73 63 61 6c 61 72 |ame for |a scalar|
|00004790| 20 76 61 72 69 61 62 6c | 65 2c 20 61 6e 20 61 72 | variabl|e, an ar|
|000047a0| 72 61 79 2c 20 61 6e 0d | 61 73 73 6f 63 69 61 74 |ray, an.|associat|
|000047b0| 69 76 65 20 61 72 72 61 | 79 2c 20 61 20 66 69 6c |ive arra|y, a fil|
|000047c0| 65 68 61 6e 64 6c 65 2c | 20 61 20 73 75 62 72 6f |ehandle,| a subro|
|000047d0| 75 74 69 6e 65 20 6e 61 | 6d 65 2c 20 61 6e 64 2f |utine na|me, and/|
|000047e0| 6f 72 20 61 0d 6c 61 62 | 65 6c 2e 20 20 53 69 6e |or a.lab|el. Sin|
|000047f0| 63 65 20 76 61 72 69 61 | 62 6c 65 20 61 6e 64 20 |ce varia|ble and |
|00004800| 61 72 72 61 79 20 72 65 | 66 65 72 65 6e 63 65 73 |array re|ferences|
|00004810| 20 61 6c 77 61 79 73 20 | 73 74 61 72 74 20 77 69 | always |start wi|
|00004820| 74 68 0d 27 24 27 2c 20 | 27 40 27 2c 20 6f 72 20 |th.'$', |'@', or |
|00004830| 27 25 27 2c 20 74 68 65 | 20 22 72 65 73 65 72 76 |'%', the| "reserv|
|00004840| 65 64 22 20 77 6f 72 64 | 73 20 61 72 65 6e 27 74 |ed" word|s aren't|
|00004850| 20 69 6e 20 66 61 63 74 | 20 72 65 73 65 72 76 65 | in fact| reserve|
|00004860| 64 0d 77 69 74 68 20 72 | 65 73 70 65 63 74 20 74 |d.with r|espect t|
|00004870| 6f 20 76 61 72 69 61 62 | 6c 65 20 6e 61 6d 65 73 |o variab|le names|
|00004880| 2e 20 20 28 54 68 65 79 | 20 41 52 45 20 72 65 73 |. (They| ARE res|
|00004890| 65 72 76 65 64 20 77 69 | 74 68 20 72 65 73 70 65 |erved wi|th respe|
|000048a0| 63 74 0d 74 6f 20 6c 61 | 62 65 6c 73 20 61 6e 64 |ct.to la|bels and|
|000048b0| 20 66 69 6c 65 68 61 6e | 64 6c 65 73 2c 20 68 6f | filehan|dles, ho|
|000048c0| 77 65 76 65 72 2c 20 77 | 68 69 63 68 20 64 6f 6e |wever, w|hich don|
|000048d0| 27 74 20 68 61 76 65 20 | 61 6e 20 69 6e 69 74 69 |'t have |an initi|
|000048e0| 61 6c 0d 73 70 65 63 69 | 61 6c 20 63 68 61 72 61 |al.speci|al chara|
|000048f0| 63 74 65 72 2e 20 20 48 | 69 6e 74 3a 20 79 6f 75 |cter. H|int: you|
|00004900| 20 63 6f 75 6c 64 20 73 | 61 79 20 6f 70 65 6e 28 | could s|ay open(|
|00004910| 4c 4f 47 2c 27 6c 6f 67 | 66 69 6c 65 27 29 0d 72 |LOG,'log|file').r|
|00004920| 61 74 68 65 72 20 74 68 | 61 6e 20 6f 70 65 6e 28 |ather th|an open(|
|00004930| 6c 6f 67 2c 27 6c 6f 67 | 66 69 6c 65 27 29 2e 20 |log,'log|file'). |
|00004940| 20 55 73 69 6e 67 20 75 | 70 70 65 72 63 61 73 65 | Using u|ppercase|
|00004950| 20 66 69 6c 65 68 61 6e | 64 6c 65 73 0d 61 6c 73 | filehan|dles.als|
|00004960| 6f 20 69 6d 70 72 6f 76 | 65 73 20 72 65 61 64 61 |o improv|es reada|
|00004970| 62 69 6c 69 74 79 20 61 | 6e 64 20 70 72 6f 74 65 |bility a|nd prote|
|00004980| 63 74 73 20 79 6f 75 20 | 66 72 6f 6d 20 63 6f 6e |cts you |from con|
|00004990| 66 6c 69 63 74 20 77 69 | 74 68 0d 66 75 74 75 72 |flict wi|th.futur|
|000049a0| 65 20 72 65 73 65 72 76 | 65 64 20 77 6f 72 64 73 |e reserv|ed words|
|000049b0| 2e 29 20 43 61 73 65 20 | 49 53 20 73 69 67 6e 69 |.) Case |IS signi|
|000049c0| 66 69 63 61 6e 74 2d 2d | 22 46 4f 4f 22 2c 20 22 |ficant--|"FOO", "|
|000049d0| 46 6f 6f 22 20 61 6e 64 | 0d 22 66 6f 6f 22 20 61 |Foo" and|."foo" a|
|000049e0| 72 65 20 61 6c 6c 20 64 | 69 66 66 65 72 65 6e 74 |re all d|ifferent|
|000049f0| 20 6e 61 6d 65 73 2e 20 | 20 4e 61 6d 65 73 20 77 | names. | Names w|
|00004a00| 68 69 63 68 20 73 74 61 | 72 74 20 77 69 74 68 20 |hich sta|rt with |
|00004a10| 61 20 6c 65 74 74 65 72 | 0d 6d 61 79 20 61 6c 73 |a letter|.may als|
|00004a20| 6f 20 63 6f 6e 74 61 69 | 6e 20 64 69 67 69 74 73 |o contai|n digits|
|00004a30| 20 61 6e 64 20 75 6e 64 | 65 72 73 63 6f 72 65 73 | and und|erscores|
|00004a40| 2e 20 20 4e 61 6d 65 73 | 20 77 68 69 63 68 20 64 |. Names| which d|
|00004a50| 6f 20 6e 6f 74 0d 73 74 | 61 72 74 20 77 69 74 68 |o not.st|art with|
|00004a60| 20 61 20 6c 65 74 74 65 | 72 20 61 72 65 20 6c 69 | a lette|r are li|
|00004a70| 6d 69 74 65 64 20 74 6f | 20 6f 6e 65 20 63 68 61 |mited to| one cha|
|00004a80| 72 61 63 74 65 72 2c 20 | 65 2e 67 2e 20 22 24 25 |racter, |e.g. "$%|
|00004a90| 22 20 6f 72 0d 22 24 24 | 22 2e 20 20 28 4d 6f 73 |" or."$$|". (Mos|
|00004aa0| 74 20 6f 66 20 74 68 65 | 20 6f 6e 65 20 63 68 61 |t of the| one cha|
|00004ab0| 72 61 63 74 65 72 20 6e | 61 6d 65 73 20 68 61 76 |racter n|ames hav|
|00004ac0| 65 20 61 20 70 72 65 64 | 65 66 69 6e 65 64 20 73 |e a pred|efined s|
|00004ad0| 69 67 6e 69 2d 0d 66 69 | 63 61 6e 63 65 20 74 6f |igni-.fi|cance to|
|00004ae0| 20 70 65 72 6c 2e 20 20 | 4d 6f 72 65 20 6c 61 74 | perl. |More lat|
|00004af0| 65 72 2e 29 0d 0d 4e 75 | 6d 65 72 69 63 20 6c 69 |er.)..Nu|meric li|
|00004b00| 74 65 72 61 6c 73 20 61 | 72 65 20 73 70 65 63 69 |terals a|re speci|
|00004b10| 66 69 65 64 20 69 6e 20 | 61 6e 79 20 6f 66 20 74 |fied in |any of t|
|00004b20| 68 65 20 75 73 75 61 6c | 20 66 6c 6f 61 74 69 6e |he usual| floatin|
|00004b30| 67 20 70 6f 69 6e 74 0d | 6f 72 20 69 6e 74 65 67 |g point.|or integ|
|00004b40| 65 72 20 66 6f 72 6d 61 | 74 73 3a 0d 0d 20 20 20 |er forma|ts:.. |
|00004b50| 20 20 20 20 20 20 20 31 | 32 33 34 35 0d 20 20 20 | 1|2345. |
|00004b60| 20 20 20 20 20 20 20 31 | 32 33 34 35 2e 36 37 0d | 1|2345.67.|
|00004b70| 20 20 20 20 20 20 20 20 | 20 20 2e 32 33 45 2d 31 | | .23E-1|
|00004b80| 30 0d 20 20 20 20 20 20 | 20 20 20 20 30 78 66 66 |0. | 0xff|
|00004b90| 66 66 20 20 20 20 20 23 | 20 68 65 78 0d 20 20 20 |ff #| hex. |
|00004ba0| 20 20 20 20 20 20 20 30 | 33 37 37 20 20 23 20 6f | 0|377 # o|
|00004bb0| 63 74 61 6c 0d 09 09 09 | 20 34 5f 32 39 34 5f 39 |ctal....| 4_294_9|
|00004bc0| 36 37 5f 32 39 36 0d 0d | 53 74 72 69 6e 67 20 6c |67_296..|String l|
|00004bd0| 69 74 65 72 61 6c 73 20 | 61 72 65 20 64 65 6c 69 |iterals |are deli|
|00004be0| 6d 69 74 65 64 20 62 79 | 20 65 69 74 68 65 72 20 |mited by| either |
|00004bf0| 73 69 6e 67 6c 65 20 6f | 72 20 64 6f 75 62 6c 65 |single o|r double|
|00004c00| 20 71 75 6f 74 65 73 2e | 0d 54 68 65 79 20 77 6f | quotes.|.They wo|
|00004c10| 72 6b 20 6d 75 63 68 20 | 6c 69 6b 65 20 73 68 65 |rk much |like she|
|00004c20| 6c 6c 20 71 75 6f 74 65 | 73 3a 20 64 6f 75 62 6c |ll quote|s: doubl|
|00004c30| 65 2d 71 75 6f 74 65 64 | 20 73 74 72 69 6e 67 20 |e-quoted| string |
|00004c40| 6c 69 74 65 72 61 6c 73 | 0d 61 72 65 20 73 75 62 |literals|.are sub|
|00004c50| 6a 65 63 74 20 74 6f 20 | 62 61 63 6b 73 6c 61 73 |ject to |backslas|
|00004c60| 68 20 61 6e 64 20 76 61 | 72 69 61 62 6c 65 20 73 |h and va|riable s|
|00004c70| 75 62 73 74 69 74 75 74 | 69 6f 6e 3b 20 73 69 6e |ubstitut|ion; sin|
|00004c80| 67 6c 65 2d 71 75 6f 74 | 65 64 0d 73 74 72 69 6e |gle-quot|ed.strin|
|00004c90| 67 73 20 61 72 65 20 6e | 6f 74 20 28 65 78 63 65 |gs are n|ot (exce|
|00004ca0| 70 74 20 66 6f 72 20 5c | 27 20 61 6e 64 20 5c 5c |pt for \|' and \\|
|00004cb0| 29 2e 20 20 54 68 65 20 | 75 73 75 61 6c 20 62 61 |). The |usual ba|
|00004cc0| 63 6b 73 6c 61 73 68 0d | 72 75 6c 65 73 20 61 70 |ckslash.|rules ap|
|00004cd0| 70 6c 79 20 66 6f 72 20 | 6d 61 6b 69 6e 67 20 63 |ply for |making c|
|00004ce0| 68 61 72 61 63 74 65 72 | 73 20 73 75 63 68 20 61 |haracter|s such a|
|00004cf0| 73 20 6e 65 77 6c 69 6e | 65 2c 20 74 61 62 2c 20 |s newlin|e, tab, |
|00004d00| 65 74 63 2e 2c 20 61 73 | 0d 77 65 6c 6c 20 61 73 |etc., as|.well as|
|00004d10| 20 73 6f 6d 65 20 6d 6f | 72 65 20 65 78 6f 74 69 | some mo|re exoti|
|00004d20| 63 20 66 6f 72 6d 73 3a | 0d 0d 20 20 20 20 20 5c |c forms:|.. \|
|00004d30| 74 20 20 20 20 20 20 20 | 20 74 61 62 0d 20 20 20 |t | tab. |
|00004d40| 20 20 5c 6e 20 20 20 20 | 20 20 20 20 6e 65 77 6c | \n | newl|
|00004d50| 69 6e 65 0d 20 20 20 20 | 20 5c 72 20 20 20 20 20 |ine. | \r |
|00004d60| 20 20 20 72 65 74 75 72 | 6e 0d 20 20 20 20 20 5c | retur|n. \|
|00004d70| 66 20 20 20 20 20 20 20 | 20 66 6f 72 6d 20 66 65 |f | form fe|
|00004d80| 65 64 0d 20 20 20 20 20 | 5c 62 20 20 20 20 20 20 |ed. |\b |
|00004d90| 20 20 62 61 63 6b 73 70 | 61 63 65 0d 20 20 20 20 | backsp|ace. |
|00004da0| 20 5c 61 20 20 20 20 20 | 20 20 20 61 6c 61 72 6d | \a | alarm|
|00004db0| 20 28 62 65 6c 6c 29 0d | 20 20 20 20 20 5c 65 20 | (bell).| \e |
|00004dc0| 20 20 20 20 20 20 20 65 | 73 63 61 70 65 0d 20 20 | e|scape. |
|00004dd0| 20 20 20 5c 30 33 33 20 | 20 20 20 20 20 6f 63 74 | \033 | oct|
|00004de0| 61 6c 20 63 68 61 72 0d | 20 20 20 20 20 5c 78 31 |al char.| \x1|
|00004df0| 62 20 20 20 20 20 20 68 | 65 78 20 63 68 61 72 0d |b h|ex char.|
|00004e00| 20 20 20 20 20 5c 63 5b | 20 20 20 20 20 20 20 63 | \c[| c|
|00004e10| 6f 6e 74 72 6f 6c 20 63 | 68 61 72 0d 20 20 20 20 |ontrol c|har. |
|00004e20| 20 5c 6c 20 20 20 20 20 | 20 20 20 6c 6f 77 65 72 | \l | lower|
|00004e30| 63 61 73 65 20 6e 65 78 | 74 20 63 68 61 72 0d 20 |case nex|t char. |
|00004e40| 20 20 20 20 5c 75 20 20 | 20 20 20 20 20 20 75 70 | \u | up|
|00004e50| 70 65 72 63 61 73 65 20 | 6e 65 78 74 20 63 68 61 |percase |next cha|
|00004e60| 72 0d 20 20 20 20 20 5c | 4c 20 20 20 20 20 20 20 |r. \|L |
|00004e70| 20 6c 6f 77 65 72 63 61 | 73 65 20 74 69 6c 6c 20 | lowerca|se till |
|00004e80| 5c 45 0d 20 20 20 20 20 | 5c 55 20 20 20 20 20 20 |\E. |\U |
|00004e90| 20 20 75 70 70 65 72 63 | 61 73 65 20 74 69 6c 6c | upperc|ase till|
|00004ea0| 20 5c 45 0d 20 20 20 20 | 20 5c 45 20 20 20 20 20 | \E. | \E |
|00004eb0| 20 20 20 65 6e 64 20 63 | 61 73 65 20 6d 6f 64 69 | end c|ase modi|
|00004ec0| 66 69 63 61 74 69 6f 6e | 0d 0d 59 6f 75 20 63 61 |fication|..You ca|
|00004ed0| 6e 20 61 6c 73 6f 20 65 | 6d 62 65 64 20 6e 65 77 |n also e|mbed new|
|00004ee0| 6c 69 6e 65 73 20 64 69 | 72 65 63 74 6c 79 20 69 |lines di|rectly i|
|00004ef0| 6e 20 79 6f 75 72 20 73 | 74 72 69 6e 67 73 2c 20 |n your s|trings, |
|00004f00| 69 2e 65 2e 20 74 68 65 | 79 0d 63 61 6e 20 65 6e |i.e. the|y.can en|
|00004f10| 64 20 6f 6e 20 61 20 64 | 69 66 66 65 72 65 6e 74 |d on a d|ifferent|
|00004f20| 20 6c 69 6e 65 20 74 68 | 61 6e 20 74 68 65 79 20 | line th|an they |
|00004f30| 62 65 67 69 6e 2e 20 20 | 54 68 69 73 20 69 73 20 |begin. |This is |
|00004f40| 6e 69 63 65 2c 20 62 75 | 74 0d 69 66 20 79 6f 75 |nice, bu|t.if you|
|00004f50| 20 66 6f 72 67 65 74 20 | 79 6f 75 72 20 74 72 61 | forget |your tra|
|00004f60| 69 6c 69 6e 67 20 71 75 | 6f 74 65 2c 20 74 68 65 |iling qu|ote, the|
|00004f70| 20 65 72 72 6f 72 20 77 | 69 6c 6c 20 6e 6f 74 20 | error w|ill not |
|00004f80| 62 65 20 72 65 70 6f 72 | 74 65 64 0d 75 6e 74 69 |be repor|ted.unti|
|00004f90| 6c 20 70 65 72 6c 20 66 | 69 6e 64 73 20 61 6e 6f |l perl f|inds ano|
|00004fa0| 74 68 65 72 20 6c 69 6e | 65 20 63 6f 6e 74 61 69 |ther lin|e contai|
|00004fb0| 6e 69 6e 67 20 74 68 65 | 20 71 75 6f 74 65 20 63 |ning the| quote c|
|00004fc0| 68 61 72 61 63 74 65 72 | 2c 0d 77 68 69 63 68 20 |haracter|,.which |
|00004fd0| 6d 61 79 20 62 65 20 6d | 75 63 68 20 66 75 72 74 |may be m|uch furt|
|00004fe0| 68 65 72 20 6f 6e 20 69 | 6e 20 74 68 65 20 73 63 |her on i|n the sc|
|00004ff0| 72 69 70 74 2e 20 20 56 | 61 72 69 61 62 6c 65 20 |ript. V|ariable |
|00005000| 73 75 62 73 74 69 74 75 | 2d 0d 74 69 6f 6e 20 69 |substitu|-.tion i|
|00005010| 6e 73 69 64 65 20 73 74 | 72 69 6e 67 73 20 69 73 |nside st|rings is|
|00005020| 20 6c 69 6d 69 74 65 64 | 20 74 6f 20 73 63 61 6c | limited| to scal|
|00005030| 61 72 20 76 61 72 69 61 | 62 6c 65 73 2c 20 6e 6f |ar varia|bles, no|
|00005040| 72 6d 61 6c 20 61 72 72 | 61 79 0d 76 61 6c 75 65 |rmal arr|ay.value|
|00005050| 73 2c 20 61 6e 64 20 61 | 72 72 61 79 20 73 6c 69 |s, and a|rray sli|
|00005060| 63 65 73 2e 20 20 28 49 | 6e 20 6f 74 68 65 72 20 |ces. (I|n other |
|00005070| 77 6f 72 64 73 2c 20 69 | 64 65 6e 74 69 66 69 65 |words, i|dentifie|
|00005080| 72 73 20 62 65 67 69 6e | 6e 69 6e 67 0d 77 69 74 |rs begin|ning.wit|
|00005090| 68 20 24 20 6f 72 20 40 | 2c 20 66 6f 6c 6c 6f 77 |h $ or @|, follow|
|000050a0| 65 64 20 62 79 20 61 6e | 20 6f 70 74 69 6f 6e 61 |ed by an| optiona|
|000050b0| 6c 20 62 72 61 63 6b 65 | 74 65 64 20 65 78 70 72 |l bracke|ted expr|
|000050c0| 65 73 73 69 6f 6e 20 61 | 73 20 61 0d 73 75 62 73 |ession a|s a.subs|
|000050d0| 63 72 69 70 74 2e 29 20 | 54 68 65 20 66 6f 6c 6c |cript.) |The foll|
|000050e0| 6f 77 69 6e 67 20 63 6f | 64 65 20 73 65 67 6d 65 |owing co|de segme|
|000050f0| 6e 74 20 70 72 69 6e 74 | 73 20 6f 75 74 20 22 54 |nt print|s out "T|
|00005100| 68 65 20 70 72 69 63 65 | 20 69 73 0d 24 31 30 30 |he price| is.$100|
|00005110| 2e 22 0d 0d 20 20 20 20 | 20 20 20 20 20 20 24 50 |.".. | $P|
|00005120| 72 69 63 65 20 3d 20 27 | 24 31 30 30 27 3b 20 20 |rice = '|$100'; |
|00005130| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 23 20 6e | | # n|
|00005140| 6f 74 20 69 6e 74 65 72 | 70 72 65 74 65 64 0d 20 |ot inter|preted. |
|00005150| 20 20 20 20 20 20 20 20 | 20 70 72 69 6e 74 20 22 | | print "|
|00005160| 54 68 65 20 70 72 69 63 | 65 20 69 73 20 24 50 72 |The pric|e is $Pr|
|00005170| 69 63 65 2e 5c 6e 22 3b | 23 20 69 6e 74 65 72 70 |ice.\n";|# interp|
|00005180| 72 65 74 65 64 0d 0d 4e | 6f 74 65 20 74 68 61 74 |reted..N|ote that|
|00005190| 20 79 6f 75 20 63 61 6e | 20 70 75 74 20 63 75 72 | you can| put cur|
|000051a0| 6c 79 20 62 72 61 63 6b | 65 74 73 20 61 72 6f 75 |ly brack|ets arou|
|000051b0| 6e 64 20 74 68 65 20 69 | 64 65 6e 74 69 66 69 65 |nd the i|dentifie|
|000051c0| 72 20 74 6f 0d 64 65 6c | 69 6d 69 74 20 69 74 20 |r to.del|imit it |
|000051d0| 66 72 6f 6d 20 66 6f 6c | 6c 6f 77 69 6e 67 20 61 |from fol|lowing a|
|000051e0| 6c 70 68 61 6e 75 6d 65 | 72 69 63 73 2e 20 20 41 |lphanume|rics. A|
|000051f0| 6c 73 6f 20 6e 6f 74 65 | 20 74 68 61 74 20 61 20 |lso note| that a |
|00005200| 73 69 6e 67 6c 65 0d 71 | 75 6f 74 65 64 20 73 74 |single.q|uoted st|
|00005210| 72 69 6e 67 20 6d 75 73 | 74 20 62 65 20 73 65 70 |ring mus|t be sep|
|00005220| 61 72 61 74 65 64 20 66 | 72 6f 6d 20 61 20 70 72 |arated f|rom a pr|
|00005230| 65 63 65 64 69 6e 67 20 | 77 6f 72 64 20 62 79 20 |eceding |word by |
|00005240| 61 20 73 70 61 63 65 2c | 0d 73 69 6e 63 65 20 73 |a space,|.since s|
|00005250| 69 6e 67 6c 65 20 71 75 | 6f 74 65 20 69 73 20 61 |ingle qu|ote is a|
|00005260| 20 76 61 6c 69 64 20 63 | 68 61 72 61 63 74 65 72 | valid c|haracter|
|00005270| 20 69 6e 20 61 6e 20 69 | 64 65 6e 74 69 66 69 65 | in an i|dentifie|
|00005280| 72 20 28 73 65 65 0d 50 | 61 63 6b 61 67 65 73 29 |r (see.P|ackages)|
|00005290| 2e 0d 0d 54 77 6f 20 73 | 70 65 63 69 61 6c 20 6c |...Two s|pecial l|
|000052a0| 69 74 65 72 61 6c 73 20 | 61 72 65 20 5f 5f 4c 49 |iterals |are __LI|
|000052b0| 4e 45 5f 5f 20 61 6e 64 | 20 5f 5f 46 49 4c 45 5f |NE__ and| __FILE_|
|000052c0| 5f 2c 20 77 68 69 63 68 | 20 72 65 70 72 65 73 65 |_, which| represe|
|000052d0| 6e 74 0d 74 68 65 20 63 | 75 72 72 65 6e 74 20 6c |nt.the c|urrent l|
|000052e0| 69 6e 65 20 6e 75 6d 62 | 65 72 20 61 6e 64 20 66 |ine numb|er and f|
|000052f0| 69 6c 65 6e 61 6d 65 20 | 61 74 20 74 68 61 74 20 |ilename |at that |
|00005300| 70 6f 69 6e 74 20 69 6e | 20 79 6f 75 72 20 70 72 |point in| your pr|
|00005310| 6f 2d 0d 67 72 61 6d 2e | 20 20 54 68 65 79 20 6d |o-.gram.| They m|
|00005320| 61 79 20 6f 6e 6c 79 20 | 62 65 20 75 73 65 64 20 |ay only |be used |
|00005330| 61 73 20 73 65 70 61 72 | 61 74 65 20 74 6f 6b 65 |as separ|ate toke|
|00005340| 6e 73 3b 20 74 68 65 79 | 20 77 69 6c 6c 20 6e 6f |ns; they| will no|
|00005350| 74 20 62 65 0d 69 6e 74 | 65 72 70 6f 6c 61 74 65 |t be.int|erpolate|
|00005360| 64 20 69 6e 74 6f 20 73 | 74 72 69 6e 67 73 2e 20 |d into s|trings. |
|00005370| 20 49 6e 20 61 64 64 69 | 74 69 6f 6e 2c 20 74 68 | In addi|tion, th|
|00005380| 65 20 74 6f 6b 65 6e 20 | 5f 5f 45 4e 44 5f 5f 20 |e token |__END__ |
|00005390| 6d 61 79 20 62 65 0d 75 | 73 65 64 20 74 6f 20 69 |may be.u|sed to i|
|000053a0| 6e 64 69 63 61 74 65 20 | 74 68 65 20 6c 6f 67 69 |ndicate |the logi|
|000053b0| 63 61 6c 20 65 6e 64 20 | 6f 66 20 74 68 65 20 73 |cal end |of the s|
|000053c0| 63 72 69 70 74 20 62 65 | 66 6f 72 65 20 74 68 65 |cript be|fore the|
|000053d0| 20 61 63 74 75 61 6c 0d | 65 6e 64 20 6f 66 20 66 | actual.|end of f|
|000053e0| 69 6c 65 2e 20 20 41 6e | 79 20 66 6f 6c 6c 6f 77 |ile. An|y follow|
|000053f0| 69 6e 67 20 74 65 78 74 | 20 69 73 20 69 67 6e 6f |ing text| is igno|
|00005400| 72 65 64 2c 20 62 75 74 | 20 6d 61 79 20 62 65 20 |red, but| may be |
|00005410| 72 65 61 64 20 76 69 61 | 20 0d 74 68 65 20 44 41 |read via| .the DA|
|00005420| 54 41 20 66 69 6c 65 68 | 61 6e 64 6c 65 2e 20 28 |TA fileh|andle. (|
|00005430| 54 68 65 20 44 41 54 41 | 20 66 69 6c 65 68 61 6e |The DATA| filehan|
|00005440| 64 6c 65 20 6d 61 79 20 | 72 65 61 64 20 64 61 74 |dle may |read dat|
|00005450| 61 20 6f 6e 6c 79 20 66 | 72 6f 6d 20 0d 74 68 65 |a only f|rom .the|
|00005460| 20 6d 61 69 6e 20 73 63 | 72 69 70 74 2c 20 62 75 | main sc|ript, bu|
|00005470| 74 20 6e 6f 74 20 66 72 | 6f 6d 20 61 6e 79 20 72 |t not fr|om any r|
|00005480| 65 71 75 69 72 65 64 20 | 66 69 6c 65 20 6f 72 20 |equired |file or |
|00005490| 65 76 61 6c 75 61 74 65 | 64 20 73 74 72 69 6e 67 |evaluate|d string|
|000054a0| 2e 29 20 20 0d 54 68 65 | 20 74 77 6f 20 63 6f 6e |.) .The| two con|
|000054b0| 74 72 6f 6c 20 63 68 61 | 72 61 63 74 65 72 73 20 |trol cha|racters |
|000054c0| 5e 44 20 61 6e 64 20 5e | 5a 20 61 72 65 20 73 79 |^D and ^|Z are sy|
|000054d0| 6e 6f 6e 79 6d 73 20 66 | 6f 72 20 5f 5f 45 4e 44 |nonyms f|or __END|
|000054e0| 5f 5f 2e 0d 0d 41 20 77 | 6f 72 64 20 74 68 61 74 |__...A w|ord that|
|000054f0| 20 64 6f 65 73 6e 27 74 | 20 68 61 76 65 20 61 6e | doesn't| have an|
|00005500| 79 20 6f 74 68 65 72 20 | 69 6e 74 65 72 70 72 65 |y other |interpre|
|00005510| 74 61 74 69 6f 6e 20 69 | 6e 20 74 68 65 20 67 72 |tation i|n the gr|
|00005520| 61 6d 6d 61 72 0d 77 69 | 6c 6c 20 62 65 20 74 72 |ammar.wi|ll be tr|
|00005530| 65 61 74 65 64 20 61 73 | 20 69 66 20 69 74 20 68 |eated as| if it h|
|00005540| 61 64 20 73 69 6e 67 6c | 65 20 71 75 6f 74 65 73 |ad singl|e quotes|
|00005550| 20 61 72 6f 75 6e 64 20 | 69 74 2e 20 20 46 6f 72 | around |it. For|
|00005560| 20 74 68 69 73 0d 70 75 | 72 70 6f 73 65 2c 20 61 | this.pu|rpose, a|
|00005570| 20 77 6f 72 64 20 63 6f | 6e 73 69 73 74 73 20 6f | word co|nsists o|
|00005580| 6e 6c 79 20 6f 66 20 61 | 6c 70 68 61 6e 75 6d 65 |nly of a|lphanume|
|00005590| 72 69 63 20 63 68 61 72 | 61 63 74 65 72 73 20 61 |ric char|acters a|
|000055a0| 6e 64 0d 75 6e 64 65 72 | 6c 69 6e 65 2c 20 61 6e |nd.under|line, an|
|000055b0| 64 20 6d 75 73 74 20 73 | 74 61 72 74 20 77 69 74 |d must s|tart wit|
|000055c0| 68 20 61 6e 20 61 6c 70 | 68 61 62 65 74 69 63 20 |h an alp|habetic |
|000055d0| 63 68 61 72 61 63 74 65 | 72 2e 20 20 41 73 20 77 |characte|r. As w|
|000055e0| 69 74 68 0d 66 69 6c 65 | 68 61 6e 64 6c 65 73 20 |ith.file|handles |
|000055f0| 61 6e 64 20 6c 61 62 65 | 6c 73 2c 20 61 20 62 61 |and labe|ls, a ba|
|00005600| 72 65 20 77 6f 72 64 20 | 74 68 61 74 20 63 6f 6e |re word |that con|
|00005610| 73 69 73 74 73 20 65 6e | 74 69 72 65 6c 79 20 6f |sists en|tirely o|
|00005620| 66 0d 6c 6f 77 65 72 63 | 61 73 65 20 6c 65 74 74 |f.lowerc|ase lett|
|00005630| 65 72 73 20 72 69 73 6b | 73 20 63 6f 6e 66 6c 69 |ers risk|s confli|
|00005640| 63 74 20 77 69 74 68 20 | 66 75 74 75 72 65 20 72 |ct with |future r|
|00005650| 65 73 65 72 76 65 64 20 | 77 6f 72 64 73 2c 20 61 |eserved |words, a|
|00005660| 6e 64 0d 69 66 20 79 6f | 75 20 75 73 65 20 74 68 |nd.if yo|u use th|
|00005670| 65 20 2d 77 20 73 77 69 | 74 63 68 2c 20 50 65 72 |e -w swi|tch, Per|
|00005680| 6c 20 77 69 6c 6c 20 77 | 61 72 6e 20 79 6f 75 20 |l will w|arn you |
|00005690| 61 62 6f 75 74 20 61 6e | 79 20 73 75 63 68 0d 77 |about an|y such.w|
|000056a0| 6f 72 64 73 2e 0d 0d 41 | 72 72 61 79 20 76 61 6c |ords...A|rray val|
|000056b0| 75 65 73 20 61 72 65 20 | 69 6e 74 65 72 70 6f 6c |ues are |interpol|
|000056c0| 61 74 65 64 20 69 6e 74 | 6f 20 64 6f 75 62 6c 65 |ated int|o double|
|000056d0| 2d 71 75 6f 74 65 64 20 | 73 74 72 69 6e 67 73 20 |-quoted |strings |
|000056e0| 62 79 20 6a 6f 69 6e 2d | 0d 69 6e 67 20 61 6c 6c |by join-|.ing all|
|000056f0| 20 74 68 65 20 65 6c 65 | 6d 65 6e 74 73 20 6f 66 | the ele|ments of|
|00005700| 20 74 68 65 20 61 72 72 | 61 79 20 77 69 74 68 20 | the arr|ay with |
|00005710| 74 68 65 20 64 65 6c 69 | 6d 69 74 65 72 20 73 70 |the deli|miter sp|
|00005720| 65 63 69 66 69 65 64 20 | 69 6e 0d 74 68 65 20 24 |ecified |in.the $|
|00005730| 22 20 76 61 72 69 61 62 | 6c 65 2c 20 73 70 61 63 |" variab|le, spac|
|00005740| 65 20 62 79 20 64 65 66 | 61 75 6c 74 2e 20 20 28 |e by def|ault. (|
|00005750| 53 69 6e 63 65 20 69 6e | 20 76 65 72 73 69 6f 6e |Since in| version|
|00005760| 73 20 6f 66 20 70 65 72 | 6c 0d 70 72 69 6f 72 20 |s of per|l.prior |
|00005770| 74 6f 20 33 2e 30 20 74 | 68 65 20 40 20 63 68 61 |to 3.0 t|he @ cha|
|00005780| 72 61 63 74 65 72 20 77 | 61 73 20 6e 6f 74 20 61 |racter w|as not a|
|00005790| 20 6d 65 74 61 63 68 61 | 72 61 63 74 65 72 20 69 | metacha|racter i|
|000057a0| 6e 20 64 6f 75 62 6c 65 | 2d 0d 71 75 6f 74 65 64 |n double|-.quoted|
|000057b0| 20 73 74 72 69 6e 67 73 | 2c 20 74 68 65 20 69 6e | strings|, the in|
|000057c0| 74 65 72 70 6f 6c 61 74 | 69 6f 6e 20 6f 66 20 40 |terpolat|ion of @|
|000057d0| 61 72 72 61 79 2c 20 24 | 61 72 72 61 79 5b 45 58 |array, $|array[EX|
|000057e0| 50 52 5d 2c 0d 40 61 72 | 72 61 79 5b 4c 49 53 54 |PR],.@ar|ray[LIST|
|000057f0| 5d 2c 20 24 61 72 72 61 | 79 7b 45 58 50 52 7d 2c |], $arra|y{EXPR},|
|00005800| 20 6f 72 20 40 61 72 72 | 61 79 7b 4c 49 53 54 7d | or @arr|ay{LIST}|
|00005810| 20 6f 6e 6c 79 20 68 61 | 70 70 65 6e 73 20 69 66 | only ha|ppens if|
|00005820| 20 61 72 72 61 79 0d 69 | 73 20 72 65 66 65 72 65 | array.i|s refere|
|00005830| 6e 63 65 64 20 65 6c 73 | 65 77 68 65 72 65 20 69 |nced els|ewhere i|
|00005840| 6e 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 6f 72 |n the pr|ogram or|
|00005850| 20 69 73 20 70 72 65 64 | 65 66 69 6e 65 64 2e 29 | is pred|efined.)|
|00005860| 20 54 68 65 0d 66 6f 6c | 6c 6f 77 69 6e 67 20 61 | The.fol|lowing a|
|00005870| 72 65 20 65 71 75 69 76 | 61 6c 65 6e 74 3a 0d 0d |re equiv|alent:..|
|00005880| 20 20 20 20 20 24 74 65 | 6d 70 20 3d 20 6a 6f 69 | $te|mp = joi|
|00005890| 6e 28 24 22 2c 40 41 52 | 47 56 29 3b 0d 20 20 20 |n($",@AR|GV);. |
|000058a0| 20 20 73 79 73 74 65 6d | 20 22 65 63 68 6f 20 24 | system| "echo $|
|000058b0| 74 65 6d 70 22 3b 0d 0d | 20 20 20 20 20 73 79 73 |temp";..| sys|
|000058c0| 74 65 6d 20 22 65 63 68 | 6f 20 40 41 52 47 56 22 |tem "ech|o @ARGV"|
|000058d0| 3b 0d 0d 0d 57 69 74 68 | 69 6e 20 73 65 61 72 63 |;...With|in searc|
|000058e0| 68 20 70 61 74 74 65 72 | 6e 73 20 28 77 68 69 63 |h patter|ns (whic|
|000058f0| 68 20 61 6c 73 6f 20 75 | 6e 64 65 72 67 6f 20 64 |h also u|ndergo d|
|00005900| 6f 75 62 6c 65 2d 71 75 | 6f 74 69 73 68 20 73 75 |ouble-qu|otish su|
|00005910| 62 73 74 69 2d 0d 74 75 | 74 69 6f 6e 29 20 74 68 |bsti-.tu|tion) th|
|00005920| 65 72 65 20 69 73 20 61 | 20 62 61 64 20 61 6d 62 |ere is a| bad amb|
|00005930| 69 67 75 69 74 79 3a 20 | 20 49 73 20 2f 24 66 6f |iguity: | Is /$fo|
|00005940| 6f 5b 62 61 72 5d 2f 20 | 74 6f 20 62 65 20 69 6e |o[bar]/ |to be in|
|00005950| 74 65 72 2d 0d 70 72 65 | 74 65 64 20 61 73 20 2f |ter-.pre|ted as /|
|00005960| 24 7b 66 6f 6f 7d 5b 62 | 61 72 5d 2f 20 28 77 68 |${foo}[b|ar]/ (wh|
|00005970| 65 72 65 20 5b 62 61 72 | 5d 20 69 73 20 61 20 63 |ere [bar|] is a c|
|00005980| 68 61 72 61 63 74 65 72 | 20 63 6c 61 73 73 20 66 |haracter| class f|
|00005990| 6f 72 20 74 68 65 0d 72 | 65 67 75 6c 61 72 20 65 |or the.r|egular e|
|000059a0| 78 70 72 65 73 73 69 6f | 6e 29 20 6f 72 20 61 73 |xpressio|n) or as|
|000059b0| 20 2f 24 7b 66 6f 6f 5b | 62 61 72 5d 7d 2f 20 28 | /${foo[|bar]}/ (|
|000059c0| 77 68 65 72 65 20 5b 62 | 61 72 5d 20 69 73 20 74 |where [b|ar] is t|
|000059d0| 68 65 20 73 75 62 2d 0d | 73 63 72 69 70 74 20 74 |he sub-.|script t|
|000059e0| 6f 20 61 72 72 61 79 20 | 40 66 6f 6f 29 3f 20 20 |o array |@foo)? |
|000059f0| 49 66 20 40 66 6f 6f 20 | 64 6f 65 73 6e 27 74 20 |If @foo |doesn't |
|00005a00| 6f 74 68 65 72 77 69 73 | 65 20 65 78 69 73 74 2c |otherwis|e exist,|
|00005a10| 20 74 68 65 6e 0d 69 74 | 27 73 20 6f 62 76 69 6f | then.it|'s obvio|
|00005a20| 75 73 6c 79 20 61 20 63 | 68 61 72 61 63 74 65 72 |usly a c|haracter|
|00005a30| 20 63 6c 61 73 73 2e 20 | 20 49 66 20 40 66 6f 6f | class. | If @foo|
|00005a40| 20 65 78 69 73 74 73 2c | 20 70 65 72 6c 20 74 61 | exists,| perl ta|
|00005a50| 6b 65 73 20 61 0d 67 6f | 6f 64 20 67 75 65 73 73 |kes a.go|od guess|
|00005a60| 20 61 62 6f 75 74 20 5b | 62 61 72 5d 2c 20 61 6e | about [|bar], an|
|00005a70| 64 20 69 73 20 61 6c 6d | 6f 73 74 20 61 6c 77 61 |d is alm|ost alwa|
|00005a80| 79 73 20 72 69 67 68 74 | 2e 20 20 49 66 20 69 74 |ys right|. If it|
|00005a90| 20 64 6f 65 73 0d 67 75 | 65 73 73 20 77 72 6f 6e | does.gu|ess wron|
|00005aa0| 67 2c 20 6f 72 20 69 66 | 20 79 6f 75 27 72 65 20 |g, or if| you're |
|00005ab0| 6a 75 73 74 20 70 6c 61 | 69 6e 20 70 61 72 61 6e |just pla|in paran|
|00005ac0| 6f 69 64 2c 20 79 6f 75 | 20 63 61 6e 20 66 6f 72 |oid, you| can for|
|00005ad0| 63 65 20 74 68 65 0d 63 | 6f 72 72 65 63 74 20 69 |ce the.c|orrect i|
|00005ae0| 6e 74 65 72 70 72 65 74 | 61 74 69 6f 6e 20 77 69 |nterpret|ation wi|
|00005af0| 74 68 20 63 75 72 6c 79 | 20 62 72 61 63 6b 65 74 |th curly| bracket|
|00005b00| 73 20 61 73 20 61 62 6f | 76 65 2e 0d 0d 41 20 6c |s as abo|ve...A l|
|00005b10| 69 6e 65 2d 6f 72 69 65 | 6e 74 65 64 20 66 6f 72 |ine-orie|nted for|
|00005b20| 6d 20 6f 66 20 71 75 6f | 74 69 6e 67 20 69 73 20 |m of quo|ting is |
|00005b30| 62 61 73 65 64 20 6f 6e | 20 74 68 65 20 73 68 65 |based on| the she|
|00005b40| 6c 6c 20 68 65 72 65 2d | 69 73 0d 73 79 6e 74 61 |ll here-|is.synta|
|00005b50| 78 2e 20 20 46 6f 6c 6c | 6f 77 69 6e 67 20 61 20 |x. Foll|owing a |
|00005b60| 3c 3c 20 79 6f 75 20 73 | 70 65 63 69 66 79 20 61 |<< you s|pecify a|
|00005b70| 20 73 74 72 69 6e 67 20 | 74 6f 20 74 65 72 6d 69 | string |to termi|
|00005b80| 6e 61 74 65 20 74 68 65 | 0d 71 75 6f 74 65 64 20 |nate the|.quoted |
|00005b90| 6d 61 74 65 72 69 61 6c | 2c 20 61 6e 64 20 61 6c |material|, and al|
|00005ba0| 6c 20 6c 69 6e 65 73 20 | 66 6f 6c 6c 6f 77 69 6e |l lines |followin|
|00005bb0| 67 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 6c 69 |g the cu|rrent li|
|00005bc0| 6e 65 20 64 6f 77 6e 20 | 74 6f 0d 74 68 65 20 74 |ne down |to.the t|
|00005bd0| 65 72 6d 69 6e 61 74 69 | 6e 67 20 73 74 72 69 6e |erminati|ng strin|
|00005be0| 67 20 61 72 65 20 74 68 | 65 20 76 61 6c 75 65 20 |g are th|e value |
|00005bf0| 6f 66 20 74 68 65 20 69 | 74 65 6d 2e 20 20 54 68 |of the i|tem. Th|
|00005c00| 65 20 74 65 72 6d 69 6e | 61 74 2d 0d 69 6e 67 20 |e termin|at-.ing |
|00005c10| 73 74 72 69 6e 67 20 6d | 61 79 20 62 65 20 65 69 |string m|ay be ei|
|00005c20| 74 68 65 72 20 61 6e 20 | 69 64 65 6e 74 69 66 69 |ther an |identifi|
|00005c30| 65 72 20 28 61 20 77 6f | 72 64 29 2c 20 6f 72 20 |er (a wo|rd), or |
|00005c40| 73 6f 6d 65 20 71 75 6f | 74 65 64 0d 74 65 78 74 |some quo|ted.text|
|00005c50| 2e 20 20 49 66 20 71 75 | 6f 74 65 64 2c 20 74 68 |. If qu|oted, th|
|00005c60| 65 20 74 79 70 65 20 6f | 66 20 71 75 6f 74 65 73 |e type o|f quotes|
|00005c70| 20 79 6f 75 20 75 73 65 | 20 64 65 74 65 72 6d 69 | you use| determi|
|00005c80| 6e 65 73 20 74 68 65 0d | 74 72 65 61 74 6d 65 6e |nes the.|treatmen|
|00005c90| 74 20 6f 66 20 74 68 65 | 20 74 65 78 74 2c 20 6a |t of the| text, j|
|00005ca0| 75 73 74 20 61 73 20 69 | 6e 20 72 65 67 75 6c 61 |ust as i|n regula|
|00005cb0| 72 20 71 75 6f 74 69 6e | 67 2e 20 20 41 6e 20 75 |r quotin|g. An u|
|00005cc0| 6e 71 75 6f 74 65 64 0d | 69 64 65 6e 74 69 66 69 |nquoted.|identifi|
|00005cd0| 65 72 20 77 6f 72 6b 73 | 20 6c 69 6b 65 20 64 6f |er works| like do|
|00005ce0| 75 62 6c 65 20 71 75 6f | 74 65 73 2e 20 20 54 68 |uble quo|tes. Th|
|00005cf0| 65 72 65 20 6d 75 73 74 | 20 62 65 20 6e 6f 20 73 |ere must| be no s|
|00005d00| 70 61 63 65 0d 62 65 74 | 77 65 65 6e 20 74 68 65 |pace.bet|ween the|
|00005d10| 20 3c 3c 20 61 6e 64 20 | 74 68 65 20 69 64 65 6e | << and |the iden|
|00005d20| 74 69 66 69 65 72 2e 20 | 20 28 49 66 20 79 6f 75 |tifier. | (If you|
|00005d30| 20 70 75 74 20 61 20 73 | 70 61 63 65 20 69 74 20 | put a s|pace it |
|00005d40| 77 69 6c 6c 0d 62 65 20 | 74 72 65 61 74 65 64 20 |will.be |treated |
|00005d50| 61 73 20 61 20 6e 75 6c | 6c 20 69 64 65 6e 74 69 |as a nul|l identi|
|00005d60| 66 69 65 72 2c 20 77 68 | 69 63 68 20 69 73 20 76 |fier, wh|ich is v|
|00005d70| 61 6c 69 64 2c 20 61 6e | 64 20 6d 61 74 63 68 65 |alid, an|d matche|
|00005d80| 73 20 74 68 65 0d 66 69 | 72 73 74 20 62 6c 61 6e |s the.fi|rst blan|
|00005d90| 6b 20 6c 69 6e 65 2d 2d | 73 65 65 20 4d 65 72 72 |k line--|see Merr|
|00005da0| 79 20 43 68 72 69 73 74 | 6d 61 73 20 65 78 61 6d |y Christ|mas exam|
|00005db0| 70 6c 65 20 62 65 6c 6f | 77 2e 29 20 54 68 65 20 |ple belo|w.) The |
|00005dc0| 74 65 72 2d 0d 6d 69 6e | 61 74 69 6e 67 20 73 74 |ter-.min|ating st|
|00005dd0| 72 69 6e 67 20 6d 75 73 | 74 20 61 70 70 65 61 72 |ring mus|t appear|
|00005de0| 20 62 79 20 69 74 73 65 | 6c 66 20 28 75 6e 71 75 | by itse|lf (unqu|
|00005df0| 6f 74 65 64 20 61 6e 64 | 20 77 69 74 68 20 6e 6f |oted and| with no|
|00005e00| 20 73 75 72 2d 0d 72 6f | 75 6e 64 69 6e 67 20 77 | sur-.ro|unding w|
|00005e10| 68 69 74 65 73 70 61 63 | 65 29 20 6f 6e 20 74 68 |hitespac|e) on th|
|00005e20| 65 20 74 65 72 6d 69 6e | 61 74 69 6e 67 20 6c 69 |e termin|ating li|
|00005e30| 6e 65 2e 0d 0d 70 72 69 | 6e 74 20 3c 3c 45 4f 46 |ne...pri|nt <<EOF|
|00005e40| 3b 20 20 20 20 20 20 20 | 20 23 20 73 61 6d 65 20 |; | # same |
|00005e50| 61 73 20 61 62 6f 76 65 | 0d 54 68 65 20 70 72 69 |as above|.The pri|
|00005e60| 63 65 20 69 73 20 24 50 | 72 69 63 65 2e 0d 45 4f |ce is $P|rice..EO|
|00005e70| 46 0d 0d 70 72 69 6e 74 | 20 3c 3c 22 45 4f 46 22 |F..print| <<"EOF"|
|00005e80| 3b 20 20 20 20 20 20 23 | 20 73 61 6d 65 20 61 73 |; #| same as|
|00005e90| 20 61 62 6f 76 65 0d 54 | 68 65 20 70 72 69 63 65 | above.T|he price|
|00005ea0| 20 69 73 20 24 50 72 69 | 63 65 2e 0d 45 4f 46 0d | is $Pri|ce..EOF.|
|00005eb0| 0d 70 72 69 6e 74 20 3c | 3c 20 78 20 31 30 3b 20 |.print <|< x 10; |
|00005ec0| 20 20 20 20 20 23 20 6e | 75 6c 6c 20 69 64 65 6e | # n|ull iden|
|00005ed0| 74 69 66 69 65 72 20 69 | 73 20 64 65 6c 69 6d 69 |tifier i|s delimi|
|00005ee0| 74 65 72 0d 4d 65 72 72 | 79 20 43 68 72 69 73 74 |ter.Merr|y Christ|
|00005ef0| 6d 61 73 21 0d 0d 70 72 | 69 6e 74 20 3c 3c 60 45 |mas!..pr|int <<`E|
|00005f00| 4f 43 60 3b 20 20 20 20 | 20 20 23 20 65 78 65 63 |OC`; | # exec|
|00005f10| 75 74 65 20 63 6f 6d 6d | 61 6e 64 73 0d 65 63 68 |ute comm|ands.ech|
|00005f20| 6f 20 68 69 20 74 68 65 | 72 65 0d 65 63 68 6f 20 |o hi the|re.echo |
|00005f30| 6c 6f 20 74 68 65 72 65 | 0d 45 4f 43 0d 0d 70 72 |lo there|.EOC..pr|
|00005f40| 69 6e 74 20 3c 3c 66 6f | 6f 2c 20 3c 3c 62 61 72 |int <<fo|o, <<bar|
|00005f50| 3b 20 23 20 79 6f 75 20 | 63 61 6e 20 73 74 61 63 |; # you |can stac|
|00005f60| 6b 20 74 68 65 6d 0d 49 | 20 73 61 69 64 20 66 6f |k them.I| said fo|
|00005f70| 6f 2e 0d 66 6f 6f 0d 49 | 20 73 61 69 64 20 62 61 |o..foo.I| said ba|
|00005f80| 72 2e 0d 62 61 72 0d 0d | 41 72 72 61 79 20 6c 69 |r..bar..|Array li|
|00005f90| 74 65 72 61 6c 73 20 61 | 72 65 20 64 65 6e 6f 74 |terals a|re denot|
|00005fa0| 65 64 20 62 79 20 73 65 | 70 61 72 61 74 69 6e 67 |ed by se|parating|
|00005fb0| 20 69 6e 64 69 76 69 64 | 75 61 6c 20 76 61 6c 75 | individ|ual valu|
|00005fc0| 65 73 20 62 79 0d 63 6f | 6d 6d 61 73 2c 20 61 6e |es by.co|mmas, an|
|00005fd0| 64 20 65 6e 63 6c 6f 73 | 69 6e 67 20 74 68 65 20 |d enclos|ing the |
|00005fe0| 6c 69 73 74 20 69 6e 20 | 70 61 72 65 6e 74 68 65 |list in |parenthe|
|00005ff0| 73 65 73 3a 0d 0d 20 20 | 20 20 20 28 4c 49 53 54 |ses:.. | (LIST|
|00006000| 29 0d 0d 49 6e 20 61 20 | 63 6f 6e 74 65 78 74 20 |)..In a |context |
|00006010| 6e 6f 74 20 72 65 71 75 | 69 72 69 6e 67 20 61 6e |not requ|iring an|
|00006020| 20 61 72 72 61 79 20 76 | 61 6c 75 65 2c 20 74 68 | array v|alue, th|
|00006030| 65 20 76 61 6c 75 65 20 | 6f 66 20 74 68 65 20 61 |e value |of the a|
|00006040| 72 72 61 79 0d 6c 69 74 | 65 72 61 6c 20 69 73 20 |rray.lit|eral is |
|00006050| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |the valu|e of the|
|00006060| 20 66 69 6e 61 6c 20 65 | 6c 65 6d 65 6e 74 2c 20 | final e|lement, |
|00006070| 61 73 20 69 6e 20 74 68 | 65 20 43 20 63 6f 6d 6d |as in th|e C comm|
|00006080| 61 0d 6f 70 65 72 61 74 | 6f 72 2e 20 20 46 6f 72 |a.operat|or. For|
|00006090| 20 65 78 61 6d 70 6c 65 | 2c 0d 0d 20 20 20 20 20 | example|,.. |
|000060a0| 20 20 20 20 20 40 66 6f | 6f 20 3d 20 28 27 63 63 | @fo|o = ('cc|
|000060b0| 27 2c 20 27 2d 45 27 2c | 20 24 62 61 72 29 3b 0d |', '-E',| $bar);.|
|000060c0| 0d 61 73 73 69 67 6e 73 | 20 74 68 65 20 65 6e 74 |.assigns| the ent|
|000060d0| 69 72 65 20 61 72 72 61 | 79 20 76 61 6c 75 65 20 |ire arra|y value |
|000060e0| 74 6f 20 61 72 72 61 79 | 20 66 6f 6f 2c 20 62 75 |to array| foo, bu|
|000060f0| 74 0d 0d 20 20 20 20 20 | 20 20 20 20 20 24 66 6f |t.. | $fo|
|00006100| 6f 20 3d 20 28 27 63 63 | 27 2c 20 27 2d 45 27 2c |o = ('cc|', '-E',|
|00006110| 20 24 62 61 72 29 3b 0d | 0d 61 73 73 69 67 6e 73 | $bar);.|.assigns|
|00006120| 20 74 68 65 20 76 61 6c | 75 65 20 6f 66 20 76 61 | the val|ue of va|
|00006130| 72 69 61 62 6c 65 20 62 | 61 72 20 74 6f 20 76 61 |riable b|ar to va|
|00006140| 72 69 61 62 6c 65 20 66 | 6f 6f 2e 20 20 4e 6f 74 |riable f|oo. Not|
|00006150| 65 20 74 68 61 74 20 74 | 68 65 0d 76 61 6c 75 65 |e that t|he.value|
|00006160| 20 6f 66 20 61 6e 20 61 | 63 74 75 61 6c 20 61 72 | of an a|ctual ar|
|00006170| 72 61 79 20 69 6e 20 61 | 20 73 63 61 6c 61 72 20 |ray in a| scalar |
|00006180| 63 6f 6e 74 65 78 74 20 | 69 73 20 74 68 65 20 6c |context |is the l|
|00006190| 65 6e 67 74 68 20 6f 66 | 20 74 68 65 0d 61 72 72 |ength of| the.arr|
|000061a0| 61 79 3b 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |ay; the |followin|
|000061b0| 67 20 61 73 73 69 67 6e | 73 20 74 6f 20 24 66 6f |g assign|s to $fo|
|000061c0| 6f 20 74 68 65 20 76 61 | 6c 75 65 20 33 3a 0d 0d |o the va|lue 3:..|
|000061d0| 20 20 20 20 20 20 20 20 | 20 20 40 66 6f 6f 20 3d | | @foo =|
|000061e0| 20 28 27 63 63 27 2c 20 | 27 2d 45 27 2c 20 24 62 | ('cc', |'-E', $b|
|000061f0| 61 72 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 24 |ar);. | $|
|00006200| 66 6f 6f 20 3d 20 40 66 | 6f 6f 3b 20 20 20 20 20 |foo = @f|oo; |
|00006210| 20 20 20 20 23 20 24 66 | 6f 6f 20 67 65 74 73 20 | # $f|oo gets |
|00006220| 33 0d 0d 59 6f 75 20 6d | 61 79 20 68 61 76 65 20 |3..You m|ay have |
|00006230| 61 6e 20 6f 70 74 69 6f | 6e 61 6c 20 63 6f 6d 6d |an optio|nal comm|
|00006240| 61 20 62 65 66 6f 72 65 | 20 74 68 65 20 63 6c 6f |a before| the clo|
|00006250| 73 69 6e 67 20 70 61 72 | 65 6e 74 68 65 73 69 73 |sing par|enthesis|
|00006260| 20 6f 66 0d 61 6e 20 61 | 72 72 61 79 20 6c 69 74 | of.an a|rray lit|
|00006270| 65 72 61 6c 2c 20 73 6f | 20 74 68 61 74 20 79 6f |eral, so| that yo|
|00006280| 75 20 63 61 6e 20 73 61 | 79 3a 0d 0d 20 20 20 20 |u can sa|y:.. |
|00006290| 20 40 66 6f 6f 20 3d 20 | 28 0d 20 20 20 20 20 31 | @foo = |(. 1|
|000062a0| 2c 0d 20 20 20 20 20 32 | 2c 0d 20 20 20 20 20 33 |,. 2|,. 3|
|000062b0| 2c 0d 20 20 20 20 20 29 | 3b 0d 0d 57 68 65 6e 20 |,. )|;..When |
|000062c0| 61 20 4c 49 53 54 20 69 | 73 20 65 76 61 6c 75 61 |a LIST i|s evalua|
|000062d0| 74 65 64 2c 20 65 61 63 | 68 20 65 6c 65 6d 65 6e |ted, eac|h elemen|
|000062e0| 74 20 6f 66 20 74 68 65 | 20 6c 69 73 74 20 69 73 |t of the| list is|
|000062f0| 20 65 76 61 6c 75 61 74 | 65 64 0d 69 6e 20 61 6e | evaluat|ed.in an|
|00006300| 20 61 72 72 61 79 20 63 | 6f 6e 74 65 78 74 2c 20 | array c|ontext, |
|00006310| 61 6e 64 20 74 68 65 20 | 72 65 73 75 6c 74 69 6e |and the |resultin|
|00006320| 67 20 61 72 72 61 79 20 | 76 61 6c 75 65 20 69 73 |g array |value is|
|00006330| 20 69 6e 74 65 72 70 6f | 2d 0d 6c 61 74 65 64 20 | interpo|-.lated |
|00006340| 69 6e 74 6f 20 4c 49 53 | 54 20 6a 75 73 74 20 61 |into LIS|T just a|
|00006350| 73 20 69 66 20 65 61 63 | 68 20 69 6e 64 69 76 69 |s if eac|h indivi|
|00006360| 64 75 61 6c 20 65 6c 65 | 6d 65 6e 74 20 77 65 72 |dual ele|ment wer|
|00006370| 65 20 61 20 6d 65 6d 62 | 65 72 0d 6f 66 20 4c 49 |e a memb|er.of LI|
|00006380| 53 54 2e 20 20 54 68 75 | 73 20 61 72 72 61 79 73 |ST. Thu|s arrays|
|00006390| 20 6c 6f 73 65 20 74 68 | 65 69 72 20 69 64 65 6e | lose th|eir iden|
|000063a0| 74 69 74 79 20 69 6e 20 | 61 20 4c 49 53 54 2d 2d |tity in |a LIST--|
|000063b0| 74 68 65 20 6c 69 73 74 | 0d 0d 20 20 20 20 20 28 |the list|.. (|
|000063c0| 40 66 6f 6f 2c 40 62 61 | 72 2c 26 53 6f 6d 65 53 |@foo,@ba|r,&SomeS|
|000063d0| 75 62 29 0d 0d 63 6f 6e | 74 61 69 6e 73 20 61 6c |ub)..con|tains al|
|000063e0| 6c 20 74 68 65 20 65 6c | 65 6d 65 6e 74 73 20 6f |l the el|ements o|
|000063f0| 66 20 40 66 6f 6f 20 66 | 6f 6c 6c 6f 77 65 64 20 |f @foo f|ollowed |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.